]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
tree-ssa-loop-unswitch.c (tree_unswitch_single_loop): Use also max_loop_iterations_int.
authorJan Hubicka <jh@suse.cz>
Thu, 21 Apr 2016 08:52:41 +0000 (10:52 +0200)
committerJan Hubicka <hubicka@gcc.gnu.org>
Thu, 21 Apr 2016 08:52:41 +0000 (08:52 +0000)
* tree-ssa-loop-unswitch.c (tree_unswitch_single_loop): Use also
max_loop_iterations_int.
(tree_unswitch_outer_loop): Likewise.

From-SVN: r235315

gcc/ChangeLog
gcc/tree-ssa-loop-unswitch.c

index 55d9708336bf72683487f047915ab60291959e73..d24599f7dcc677e2c12146c904cbbd3cb03d3985 100644 (file)
@@ -1,3 +1,9 @@
+2016-04-18  Jan Hubicka  <jh@suse.cz>
+
+       * tree-ssa-loop-unswitch.c (tree_unswitch_single_loop): Use also
+       max_loop_iterations_int.
+       (tree_unswitch_outer_loop): Likewise.
+
 2016-04-20  Bin Cheng  <bin.cheng@arm.com>
 
        PR tree-optimization/69489
index dd6fd01256a27998bfb3f3eb9089e4d8597cd380..77acd66e997351a6fe4898e31960ef07aeedf1a8 100644 (file)
@@ -223,6 +223,8 @@ tree_unswitch_single_loop (struct loop *loop, int num)
       /* If the loop is not expected to iterate, there is no need
         for unswitching.  */
       iterations = estimated_loop_iterations_int (loop);
+      if (iterations < 0)
+        iterations = max_loop_iterations_int (loop);
       if (iterations >= 0 && iterations <= 1)
        {
          if (dump_file && (dump_flags & TDF_DETAILS))
@@ -439,6 +441,8 @@ tree_unswitch_outer_loop (struct loop *loop)
   /* If the loop is not expected to iterate, there is no need
       for unswitching.  */
   iterations = estimated_loop_iterations_int (loop);
+  if (iterations < 0)
+    iterations = max_loop_iterations_int (loop);
   if (iterations >= 0 && iterations <= 1)
     {
       if (dump_file && (dump_flags & TDF_DETAILS))