summaryrefslogtreecommitdiff
path: root/gcc/graphite-sese-to-poly.c
diff options
context:
space:
mode:
authorSebastian Pop <sebastian.pop@amd.com>2010-08-11 20:28:31 +0000
committerSebastian Pop <spop@gcc.gnu.org>2010-08-11 20:28:31 +0000
commit87b28340fd2de93c135ec1529227ca77722be056 (patch)
treebd5e04f703bdcd2dc9eaff75ef3072618135ffcd /gcc/graphite-sese-to-poly.c
parent3dd2dd5736074dd5accdbf48c7181597263e456b (diff)
downloadgcc-87b28340fd2de93c135ec1529227ca77722be056.tar.gz
Do not rewrite out of SSA scalar phi nodes that can be scev_analyzable_p.
2010-07-15 Sebastian Pop <sebastian.pop@amd.com> * graphite-sese-to-poly.c (reduction_phi_p): Do not rewrite out of SSA scalar phi nodes that can be scev_analyzable_p. * gfortran.dg/graphite/id-20.f: Adjust testcase. From-SVN: r163148
Diffstat (limited to 'gcc/graphite-sese-to-poly.c')
-rw-r--r--gcc/graphite-sese-to-poly.c20
1 files changed, 4 insertions, 16 deletions
diff --git a/gcc/graphite-sese-to-poly.c b/gcc/graphite-sese-to-poly.c
index 04202854128..7244ba9415c 100644
--- a/gcc/graphite-sese-to-poly.c
+++ b/gcc/graphite-sese-to-poly.c
@@ -165,8 +165,6 @@ static bool
reduction_phi_p (sese region, gimple_stmt_iterator *psi)
{
loop_p loop;
- tree scev;
- affine_iv iv;
gimple phi = gsi_stmt (*psi);
tree res = gimple_phi_result (phi);
@@ -189,11 +187,11 @@ reduction_phi_p (sese region, gimple_stmt_iterator *psi)
return false;
}
- /* Main induction variables with constant strides in LOOP are not
- reductions. */
- if (simple_iv (loop, loop, res, &iv, true))
+ if (scev_analyzable_p (res, region))
{
- if (integer_zerop (iv.step))
+ tree scev = scalar_evolution_in_region (region, loop, res);
+
+ if (evolution_function_is_invariant_p (scev, loop->num))
remove_invariant_phi (region, psi);
else
gsi_next (psi);
@@ -201,16 +199,6 @@ reduction_phi_p (sese region, gimple_stmt_iterator *psi)
return false;
}
- scev = scalar_evolution_in_region (region, loop, res);
- if (chrec_contains_undetermined (scev))
- return true;
-
- if (evolution_function_is_invariant_p (scev, loop->num))
- {
- remove_invariant_phi (region, psi);
- return false;
- }
-
/* All the other cases are considered reductions. */
return true;
}