From: rakdver Date: Fri, 1 Oct 2004 18:26:37 +0000 (+0000) Subject: * common.opt (ftree-loop-ivcanon): Enable by default. X-Git-Url: http://git.sourceforge.jp/view?p=pf3gnuchains%2Fgcc-fork.git;a=commitdiff_plain;h=08162157fe2c4acfabffae1f9729bc0805ad4f0b * 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. * 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 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 5233ce39abd..f5e780e8cc2 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2004-10-01 Zdenek Dvorak + + * 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 * config/arm/arm.c (thumb_compute_saved_rag_mask): Or with bitmask, diff --git a/gcc/common.opt b/gcc/common.opt index f39cde12ac1..2c5538c4a3e 100644 --- a/gcc/common.opt +++ b/gcc/common.opt @@ -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 diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 1b02395d852..901edf25804 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2004-10-01 Zdenek Dvorak + + * gcc.dg/tree-ssa/loop-1.c: Check that unrolling occurs already on + tree level. + 2004-10-01 Andrew Pinski * gcc.dg/tree-ssa/pr17343.c: Remove. diff --git a/gcc/testsuite/gcc.dg/tree-ssa/loop-1.c b/gcc/testsuite/gcc.dg/tree-ssa/loop-1.c index 759a9798321..f2860997a62 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/loop-1.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/loop-1.c @@ -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} } */ diff --git a/gcc/tree-ssa-loop-ivcanon.c b/gcc/tree-ssa-loop-ivcanon.c index 66fee03b1a1..4635a023962 100644 --- a/gcc/tree-ssa-loop-ivcanon.c +++ b/gcc/tree-ssa-loop-ivcanon.c @@ -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)