From 3bbbcdff3d9d98e86abbd8ce8090b8fbb518bfba Mon Sep 17 00:00:00 2001 From: rakdver Date: Wed, 31 Jan 2007 13:50:06 +0000 Subject: * cfgloop.h: Include vec-prim.h. (enum li_flags): Remove LI_ONLY_OLD. (loop_iterator): Changed. (fel_next, fel_init): Iterate over loop tree. (FOR_EACH_LOOP_BREAK): New macro. * loop-unswitch.c (unswitch_loops): Do not pass LI_ONLY_OLD to FOR_EACH_LOOP. * tree-ssa-loop-unswitch.c (tree_ssa_unswitch_loops): Ditto. * modulo-sched.c (sms_schedule): Ditto. * tree-vectorizer.c (vectorize_loops): Ditto. * doc/loop.texi: Update information on loop numbering and behavior of FOR_EACH_LOOP wrto new loops. * tree-scalar-evolution.c (compute_overall_effect_of_inner_loop, add_to_evolution_1): Test nestedness of loops instead of comparing their numbers. * tree-chrec.c (chrec_fold_plus_poly_poly, chrec_fold_multiply_poly_poly, chrec_evaluate, hide_evolution_in_other_loops_than_loop, chrec_component_in_loop_num, reset_evolution_in_loop): Ditto. * Makefile.in (CFGLOOP_H): Add vecprim.h dependency. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@121422 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/tree-scalar-evolution.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'gcc/tree-scalar-evolution.c') diff --git a/gcc/tree-scalar-evolution.c b/gcc/tree-scalar-evolution.c index a1fe07a9dc8..43a5e27ddba 100644 --- a/gcc/tree-scalar-evolution.c +++ b/gcc/tree-scalar-evolution.c @@ -465,9 +465,11 @@ compute_overall_effect_of_inner_loop (struct loop *loop, tree evolution_fn) else if (TREE_CODE (evolution_fn) == POLYNOMIAL_CHREC) { - if (CHREC_VARIABLE (evolution_fn) >= (unsigned) loop->num) + struct loop *inner_loop = get_chrec_loop (evolution_fn); + + if (inner_loop == loop + || flow_loop_nested_p (loop, inner_loop)) { - struct loop *inner_loop = get_chrec_loop (evolution_fn); tree nb_iter = number_of_latch_executions (inner_loop); if (nb_iter == chrec_dont_know) @@ -646,18 +648,21 @@ add_to_evolution_1 (unsigned loop_nb, tree chrec_before, tree to_add, tree at_stmt) { tree type, left, right; + struct loop *loop = get_loop (loop_nb), *chloop; switch (TREE_CODE (chrec_before)) { case POLYNOMIAL_CHREC: - if (CHREC_VARIABLE (chrec_before) <= loop_nb) + chloop = get_chrec_loop (chrec_before); + if (chloop == loop + || flow_loop_nested_p (chloop, loop)) { unsigned var; type = chrec_type (chrec_before); /* When there is no evolution part in this loop, build it. */ - if (CHREC_VARIABLE (chrec_before) < loop_nb) + if (chloop != loop) { var = loop_nb; left = chrec_before; @@ -679,6 +684,8 @@ add_to_evolution_1 (unsigned loop_nb, tree chrec_before, tree to_add, } else { + gcc_assert (flow_loop_nested_p (loop, chloop)); + /* Search the evolution in LOOP_NB. */ left = add_to_evolution_1 (loop_nb, CHREC_LEFT (chrec_before), to_add, at_stmt); -- cgit v1.2.1