]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
tree-ssa-pre.c (fini_pre): Take in_fre parameter.
authorRichard Guenther <rguenther@suse.de>
Fri, 1 Aug 2008 14:42:42 +0000 (14:42 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Fri, 1 Aug 2008 14:42:42 +0000 (14:42 +0000)
2008-08-01  Richard Guenther  <rguenther@suse.de>

* tree-ssa-pre.c (fini_pre): Take in_fre parameter.  Free
loop information only if we initialized it.
(execute_pre): Call fini_pre with in_fre.
* tree-ssa-loop-ivcanon (try_unroll_loop_completely): Dump
if we do not unroll because we hit max-completely-peeled-insns.
Use our estimation for consistency, do allow shrinking.

From-SVN: r138522

gcc/ChangeLog
gcc/tree-ssa-loop-ivcanon.c
gcc/tree-ssa-pre.c

index 42c6c42818b5237f2355d5922ff74e0fe0c488da..7b8f8bd66512832b3b7c8308dbe7dd73e50a6f83 100644 (file)
@@ -1,3 +1,12 @@
+2008-08-01  Richard Guenther  <rguenther@suse.de>
+
+       * tree-ssa-pre.c (fini_pre): Take in_fre parameter.  Free
+       loop information only if we initialized it.
+       (execute_pre): Call fini_pre with in_fre.
+       * tree-ssa-loop-ivcanon (try_unroll_loop_completely): Dump
+       if we do not unroll because we hit max-completely-peeled-insns.
+       Use our estimation for consistency, do allow shrinking.
+
 2008-08-01  Richard Guenther  <rguenther@suse.de>
 
        PR middle-end/36997
index dc863f8b8a55a97078de74f574ee5977a91e8170..0096546534291fed580cf413a1b12dd9aa97af01 100644 (file)
@@ -184,10 +184,6 @@ try_unroll_loop_completely (struct loop *loop,
 
       ninsns = tree_num_loop_insns (loop, &eni_size_weights);
 
-      if (n_unroll * ninsns
-         > (unsigned) PARAM_VALUE (PARAM_MAX_COMPLETELY_PEELED_INSNS))
-       return false;
-
       unr_insns = estimated_unrolled_size (ninsns, n_unroll);
       if (dump_file && (dump_flags & TDF_DETAILS))
        {
@@ -196,6 +192,17 @@ try_unroll_loop_completely (struct loop *loop,
                   (int) unr_insns);
        }
 
+      if (unr_insns > ninsns
+         && (unr_insns
+             > (unsigned) PARAM_VALUE (PARAM_MAX_COMPLETELY_PEELED_INSNS)))
+       {
+         if (dump_file && (dump_flags & TDF_DETAILS))
+           fprintf (dump_file, "Not unrolling loop %d "
+                    "(--param max-completely-peeled-insns limit reached).\n",
+                    loop->num);
+         return false;
+       }
+
       if (ul == UL_NO_GROWTH
          && unr_insns > ninsns)
        {
index c98a18a772c9e57685bb5bea31bf797bb7a27420..336c54ec7004cd68006ed70f85bbefdd1b5f9ef0 100644 (file)
@@ -4086,7 +4086,7 @@ init_pre (bool do_fre)
 /* Deallocate data structures used by PRE.  */
 
 static void
-fini_pre (void)
+fini_pre (bool do_fre)
 {
   basic_block bb;
 
@@ -4117,7 +4117,7 @@ fini_pre (void)
 
   BITMAP_FREE (need_eh_cleanup);
 
-  if (current_loops != NULL)
+  if (!do_fre)
     loop_optimizer_finalize ();
 }
 
@@ -4192,7 +4192,7 @@ execute_pre (bool do_fre ATTRIBUTE_UNUSED)
   if (!do_fre)
     remove_dead_inserted_code ();
 
-  fini_pre ();
+  fini_pre (do_fre);
 
   return todo;
 }