From 67a97bd851515ff1b62b80ee3ad571163209e72b Mon Sep 17 00:00:00 2001 From: rguenth Date: Wed, 18 Feb 2015 13:08:58 +0000 Subject: 2015-02-18 Richard Biener PR tree-optimization/65063 * tree-predcom.c (determine_unroll_factor): Return 1 if we have replaced looparound PHIs. * gcc.dg/pr65063.c: New testcase. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@220788 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/tree-predcom.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'gcc/tree-predcom.c') diff --git a/gcc/tree-predcom.c b/gcc/tree-predcom.c index 8dac1ba5afd..03a38b4de84 100644 --- a/gcc/tree-predcom.c +++ b/gcc/tree-predcom.c @@ -1775,9 +1775,21 @@ determine_unroll_factor (vec chains) FOR_EACH_VEC_ELT (chains, i, chain) { - if (chain->type == CT_INVARIANT || chain->combined) + if (chain->type == CT_INVARIANT) continue; + if (chain->combined) + { + /* For combined chains, we can't handle unrolling if we replace + looparound PHIs. */ + dref a; + unsigned j; + for (j = 1; chain->refs.iterate (j, &a); j++) + if (gimple_code (a->stmt) == GIMPLE_PHI) + return 1; + continue; + } + /* The best unroll factor for this chain is equal to the number of temporary variables that we create for it. */ af = chain->length; -- cgit v1.2.1