From: spop Date: Wed, 9 Jun 2010 22:09:41 +0000 (+0000) Subject: Call compute_overall_effect_of_inner_loop from instantiate_scev_name. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dfeb6545e649ba53adf17b8d77f6499b7cb02977;p=thirdparty%2Fgcc.git Call compute_overall_effect_of_inner_loop from instantiate_scev_name. 2010-06-09 Sebastian Pop * tree-scalar-evolution.c (instantiate_scev_name): Do not fail the scev analysis when the variable is not used outside the loop in a close phi node: call compute_overall_effect_of_inner_loop. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@160510 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 111d1e57a5ee..8babd20f44f8 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2010-06-09 Sebastian Pop + + * tree-scalar-evolution.c (instantiate_scev_name): Do not fail + the scev analysis when the variable is not used outside the loop + in a close phi node: call compute_overall_effect_of_inner_loop. + 2010-06-09 Sebastian Pop * graphite-sese-to-poly.c (single_pred_cond): Renamed diff --git a/gcc/tree-scalar-evolution.c b/gcc/tree-scalar-evolution.c index 5eb61740bee8..13d897fd5ced 100644 --- a/gcc/tree-scalar-evolution.c +++ b/gcc/tree-scalar-evolution.c @@ -2172,9 +2172,19 @@ instantiate_scev_name (basic_block instantiate_below, else res = chrec; - if (res == NULL_TREE - || !dominated_by_p (CDI_DOMINATORS, instantiate_below, - gimple_bb (SSA_NAME_DEF_STMT (res)))) + /* When there is no loop_closed_phi_def, it means that the + variable is not used after the loop: try to still compute the + value of the variable when exiting the loop. */ + if (res == NULL_TREE) + { + loop_p loop = loop_containing_stmt (SSA_NAME_DEF_STMT (chrec)); + res = analyze_scalar_evolution (loop, chrec); + res = compute_overall_effect_of_inner_loop (loop, res); + res = instantiate_scev_r (instantiate_below, evolution_loop, res, + fold_conversions, cache, size_expr); + } + else if (!dominated_by_p (CDI_DOMINATORS, instantiate_below, + gimple_bb (SSA_NAME_DEF_STMT (res)))) res = chrec_dont_know; }