aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-loop-linear.c
diff options
context:
space:
mode:
authorSebastian Pop <pop@cri.ensmp.fr>2006-05-17 16:25:59 +0200
committerSebastian Pop <spop@gcc.gnu.org>2006-05-17 14:25:59 +0000
commitc93c502529fb81ef96ecf90dcc19568227c5b4cb (patch)
tree07cae7d173df3ab165bcf789fe48c1aeddde3dda /gcc/tree-loop-linear.c
parent46343456ba95ba86b04b8a21e91095cf6b2ec8e4 (diff)
downloadgcc-c93c502529fb81ef96ecf90dcc19568227c5b4cb.zip
gcc-c93c502529fb81ef96ecf90dcc19568227c5b4cb.tar.gz
gcc-c93c502529fb81ef96ecf90dcc19568227c5b4cb.tar.bz2
re PR tree-optimization/20256 (Perfect nest transformation not conservative enough)
PR middle-end/20256 PR middle-end/26435 * tree-loop-linear.c (linear_transform_loops): Don't test perfect_nest_p. Call rewrite_into_loop_closed_ssa only when something changed. * lambda.h (gcc_loopnest_to_lambda_loopnest): Update declaration. * lambda-code.c (can_convert_to_perfect_nest): Declared. (gcc_loopnest_to_lambda_loopnest): Removed need_perfect_nest parameter. Test for perfect_nest_p here. Fix formating. (replace_uses_equiv_to_x_with_y): Fix formating. (stmt_uses_op): Removed. (can_convert_to_perfect_nest): Removed loopivs parameter. Complete the test by checking the scalar dependences. (perfect_nestify): Remove the test for can_convert_to_perfect_nest. Fix formating. From-SVN: r113862
Diffstat (limited to 'gcc/tree-loop-linear.c')
-rw-r--r--gcc/tree-loop-linear.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/gcc/tree-loop-linear.c b/gcc/tree-loop-linear.c
index c648ef7..e0f5bd2 100644
--- a/gcc/tree-loop-linear.c
+++ b/gcc/tree-loop-linear.c
@@ -241,6 +241,7 @@ try_interchange_loops (lambda_trans_matrix trans,
void
linear_transform_loops (struct loops *loops)
{
+ bool modified = false;
unsigned int i;
VEC(tree,heap) *oldivs = NULL;
VEC(tree,heap) *invariants = NULL;
@@ -255,7 +256,6 @@ linear_transform_loops (struct loops *loops)
lambda_loopnest before, after;
lambda_trans_matrix trans;
bool problem = false;
- bool need_perfect_nest = false;
/* If it's not a loop nest, we don't want it.
We also don't handle sibling loops properly,
which are loops of the following form:
@@ -319,13 +319,9 @@ linear_transform_loops (struct loops *loops)
continue;
}
- if (!perfect_nest_p (loop_nest))
- need_perfect_nest = true;
+ before = gcc_loopnest_to_lambda_loopnest (loops, loop_nest, &oldivs,
+ &invariants);
- before = gcc_loopnest_to_lambda_loopnest (loops,
- loop_nest, &oldivs,
- &invariants,
- need_perfect_nest);
if (!before)
continue;
@@ -345,6 +341,7 @@ linear_transform_loops (struct loops *loops)
lambda_loopnest_to_gcc_loopnest (loop_nest, oldivs, invariants,
after, trans);
+ modified = true;
if (dump_file)
fprintf (dump_file, "Successfully transformed loop.\n");
@@ -356,5 +353,7 @@ linear_transform_loops (struct loops *loops)
VEC_free (tree, heap, oldivs);
VEC_free (tree, heap, invariants);
scev_reset ();
- rewrite_into_loop_closed_ssa (NULL, TODO_update_ssa_full_phi);
+
+ if (modified)
+ rewrite_into_loop_closed_ssa (NULL, TODO_update_ssa_full_phi);
}