OSDN Git Service

* common.opt (ftree-loop-ivcanon): Enable by default.
authorrakdver <rakdver@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 1 Oct 2004 18:26:37 +0000 (18:26 +0000)
committerrakdver <rakdver@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 1 Oct 2004 18:26:37 +0000 (18:26 +0000)
* tree-ssa-loop-ivcanon.c (try_unroll_loop_completely):
Enable complete loop unrolling.
(canonicalize_induction_variables, tree_unroll_loops_completely):
Reset scev info.

* gcc.dg/tree-ssa/loop-1.c: Check that unrolling occurs already on
tree level.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@88404 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/common.opt
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/tree-ssa/loop-1.c
gcc/tree-ssa-loop-ivcanon.c

index 5233ce3..f5e780e 100644 (file)
@@ -1,3 +1,11 @@
+2004-10-01  Zdenek Dvorak  <dvorakz@suse.cz>
+
+       * common.opt (ftree-loop-ivcanon): Enable by default.
+       * tree-ssa-loop-ivcanon.c (try_unroll_loop_completely):
+       Enable complete loop unrolling.
+       (canonicalize_induction_variables, tree_unroll_loops_completely):
+       Reset scev info.
+
 2004-01-01  Paul Brook  <paul@codesourcery.com>
 
        * config/arm/arm.c (thumb_compute_saved_rag_mask): Or with bitmask,
index f39cde1..2c5538c 100644 (file)
@@ -857,7 +857,7 @@ Common Report Var(flag_tree_loop_linear)
 Enable linear loop transforms on trees
 
 ftree-loop-ivcanon
-Common Report Var(flag_tree_loop_ivcanon)
+Common Report Var(flag_tree_loop_ivcanon) Init(1)
 Create canonical induction variables in loops
 
 ftree-loop-optimize
index 1b02395..901edf2 100644 (file)
@@ -1,3 +1,8 @@
+2004-10-01  Zdenek Dvorak  <dvorakz@suse.cz>
+
+       * gcc.dg/tree-ssa/loop-1.c: Check that unrolling occurs already on
+       tree level.
+
 2004-10-01  Andrew Pinski  <pinskia@physics.uc.edu>
 
        * gcc.dg/tree-ssa/pr17343.c: Remove.
index 759a979..f286099 100644 (file)
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O1 -ftree-loop-ivcanon -funroll-loops -fdump-tree-ivcanon-details" } */
+/* { dg-options "-O1 -ftree-loop-ivcanon -funroll-loops -fdump-tree-ivcanon-details -fdump-tree-cunroll-details -fdump-tree-vars" } */
 
 /* On 31-bit S/390 the function address will be stored (once) in the literal pool,
    so scan-assembler-times "foo" will return 1 even if the loop is fully unrolled.
@@ -17,6 +17,8 @@ void xxx(void)
 /* We should be able to find out that the loop iterates four times and unroll it completely.  */
 
 /* { dg-final { scan-tree-dump-times "Added canonical iv to loop 1, 4 iterations" 1 "ivcanon"} } */
+/* { dg-final { scan-tree-dump-times "Unrolled loop 1 completely" 1 "cunroll"} } */
+/* { dg-final { scan-tree-dump-times "foo" 5 "vars"} } */
 /* { dg-final { scan-assembler-times "foo" 5} } */
 
 
index 66fee03..4635a02 100644 (file)
@@ -175,12 +175,9 @@ try_unroll_loop_completely (struct loops *loops ATTRIBUTE_UNUSED,
       COND_EXPR_COND (cond) = dont_exit;
       modify_stmt (cond);
 
-#if 0
-      /* The necessary infrastructure is not in yet.  */
       if (!tree_duplicate_loop_to_header_edge (loop, loop_preheader_edge (loop),
                                               loops, n_unroll, NULL,
                                               NULL, NULL, NULL, 0))
-#endif
        {
          COND_EXPR_COND (cond) = old_cond;
          return false;
@@ -263,6 +260,10 @@ canonicalize_induction_variables (struct loops *loops)
        canonicalize_loop_induction_variables (loops, loop, true, false, true);
     }
 
+  /* Clean up the information about numbers of iterations, since brute force
+     evaluation could reveal new information.  */
+  scev_reset ();
+
 #if 0
   /* The necessary infrastructure is not in yet.  */
   if (changed)
@@ -291,6 +292,10 @@ tree_unroll_loops_completely (struct loops *loops)
                                                        !flag_tree_loop_ivcanon);
     }
 
+  /* Clean up the information about numbers of iterations, since complete
+     unrolling might have invalidated it.  */
+  scev_reset ();
+
 #if 0
   /* The necessary infrastructure is not in yet.  */
   if (changed)