tree-scalar-evolution.c (instantiate_parameters_1): An SSA_NAME defined in a loop at depth 0 is invariant.
* tree-scalar-evolution.c (instantiate_parameters_1): An SSA_NAME defined in a loop at depth 0 is invariant. * tree-chrec.c (evolution_function_is_invariant_rec_p): Ditto. * tree-ssa-loop-ivopts.c (expr_invariant_in_loop_p): Should never be called at loop depth 0. From-SVN: r132835
This commit is contained in:
parent
9310e5e318
commit
6a732743bd
|
@ -1,3 +1,11 @@
|
||||||
|
2008-03-02 Sebastian Pop <sebastian.pop@amd.com>
|
||||||
|
|
||||||
|
* tree-scalar-evolution.c (instantiate_parameters_1): An SSA_NAME
|
||||||
|
defined in a loop at depth 0 is invariant.
|
||||||
|
* tree-chrec.c (evolution_function_is_invariant_rec_p): Ditto.
|
||||||
|
* tree-ssa-loop-ivopts.c (expr_invariant_in_loop_p): Should never
|
||||||
|
be called at loop depth 0.
|
||||||
|
|
||||||
2008-03-02 Jakub Jelinek <jakub@redhat.com>
|
2008-03-02 Jakub Jelinek <jakub@redhat.com>
|
||||||
|
|
||||||
PR driver/35420
|
PR driver/35420
|
||||||
|
|
|
@ -948,8 +948,9 @@ evolution_function_is_invariant_rec_p (tree chrec, int loopnum)
|
||||||
if (evolution_function_is_constant_p (chrec))
|
if (evolution_function_is_constant_p (chrec))
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
if (TREE_CODE (chrec) == SSA_NAME
|
if (TREE_CODE (chrec) == SSA_NAME
|
||||||
&& expr_invariant_in_loop_p (get_loop (loopnum), chrec))
|
&& (loopnum == 0
|
||||||
|
|| expr_invariant_in_loop_p (get_loop (loopnum), chrec)))
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
if (TREE_CODE (chrec) == POLYNOMIAL_CHREC)
|
if (TREE_CODE (chrec) == POLYNOMIAL_CHREC)
|
||||||
|
|
|
@ -1971,6 +1971,7 @@ instantiate_parameters_1 (struct loop *loop, tree chrec, int flags, htab_t cache
|
||||||
/* A parameter (or loop invariant and we do not want to include
|
/* A parameter (or loop invariant and we do not want to include
|
||||||
evolutions in outer loops), nothing to do. */
|
evolutions in outer loops), nothing to do. */
|
||||||
if (!def_bb
|
if (!def_bb
|
||||||
|
|| loop_depth (def_bb->loop_father) == 0
|
||||||
|| (!(flags & INSERT_SUPERLOOP_CHRECS)
|
|| (!(flags & INSERT_SUPERLOOP_CHRECS)
|
||||||
&& !flow_bb_inside_loop_p (loop, def_bb)))
|
&& !flow_bb_inside_loop_p (loop, def_bb)))
|
||||||
return chrec;
|
return chrec;
|
||||||
|
|
|
@ -1254,7 +1254,8 @@ find_interesting_uses_cond (struct ivopts_data *data, tree stmt, tree *cond_p)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Returns true if expression EXPR is obviously invariant in LOOP,
|
/* Returns true if expression EXPR is obviously invariant in LOOP,
|
||||||
i.e. if all its operands are defined outside of the LOOP. */
|
i.e. if all its operands are defined outside of the LOOP. LOOP
|
||||||
|
should not be the function body. */
|
||||||
|
|
||||||
bool
|
bool
|
||||||
expr_invariant_in_loop_p (struct loop *loop, tree expr)
|
expr_invariant_in_loop_p (struct loop *loop, tree expr)
|
||||||
|
@ -1262,6 +1263,8 @@ expr_invariant_in_loop_p (struct loop *loop, tree expr)
|
||||||
basic_block def_bb;
|
basic_block def_bb;
|
||||||
unsigned i, len;
|
unsigned i, len;
|
||||||
|
|
||||||
|
gcc_assert (loop_depth (loop) > 0);
|
||||||
|
|
||||||
if (is_gimple_min_invariant (expr))
|
if (is_gimple_min_invariant (expr))
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue