summaryrefslogtreecommitdiff
path: root/gcc/lambda-code.c
diff options
context:
space:
mode:
authordberlin <dberlin@138bc75d-0d04-0410-961f-82ee72b054a4>2004-12-19 19:00:35 +0000
committerdberlin <dberlin@138bc75d-0d04-0410-961f-82ee72b054a4>2004-12-19 19:00:35 +0000
commit2beaad1693e0a578eb5812a2d09365f3ace1b6eb (patch)
tree9c2fb61ace2db3672cc36610d33c2b4c8919f5b2 /gcc/lambda-code.c
parent34991dc4399911aa11849768552bb83a95bd4283 (diff)
downloadgcc-2beaad1693e0a578eb5812a2d09365f3ace1b6eb.tar.gz
2004-12-18 Daniel Berlin <dberlin@dberlin.org>
* lambda-code.c (can_convert_to_perfect_nest): Make checking match up with what perfect_nestify can actually handle. (perfect_nestify): Don't return false in the phi node loop. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@92381 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/lambda-code.c')
-rw-r--r--gcc/lambda-code.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/gcc/lambda-code.c b/gcc/lambda-code.c
index 1fc3af52d9b..40f3ac36883 100644
--- a/gcc/lambda-code.c
+++ b/gcc/lambda-code.c
@@ -2189,9 +2189,10 @@ can_convert_to_perfect_nest (struct loop *loop,
VEC (tree) *loopivs)
{
basic_block *bbs;
- tree exit_condition;
+ tree exit_condition, phi;
size_t i;
block_stmt_iterator bsi;
+ basic_block exitdest;
/* Can't handle triply nested+ loops yet. */
if (!loop->inner || loop->inner->inner)
@@ -2233,6 +2234,16 @@ can_convert_to_perfect_nest (struct loop *loop,
}
}
}
+
+ /* We also need to make sure the loop exit only has simple copy phis in it,
+ otherwise we don't know how to transform it into a perfect nest right
+ now. */
+ exitdest = loop->single_exit->dest;
+
+ for (phi = phi_nodes (exitdest); phi; phi = PHI_CHAIN (phi))
+ if (PHI_NUM_ARGS (phi) != 1)
+ return false;
+
return true;
}
@@ -2309,9 +2320,6 @@ perfect_nestify (struct loops *loops,
for (phi = phi_nodes (olddest); phi; phi = PHI_CHAIN (phi))
{
- /* These should be simple exit phi copies. */
- if (PHI_NUM_ARGS (phi) != 1)
- return false;
VEC_safe_push (tree, phis, PHI_RESULT (phi));
VEC_safe_push (tree, phis, PHI_ARG_DEF (phi, 0));
mark_for_rewrite (PHI_RESULT (phi));