summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2009-01-05 21:17:27 +0000
committerEvan Cheng <evan.cheng@apple.com>2009-01-05 21:17:27 +0000
commit8804293fe977b262865caf28a70ed1fed1c93645 (patch)
treeb636872b79cf3b0fb4f241dde7ee4a1eec067b73 /llvm/lib
parent84434a692b2347a33ceb1aadc16281161cccc307 (diff)
downloadbcm5719-llvm-8804293fe977b262865caf28a70ed1fed1c93645.tar.gz
bcm5719-llvm-8804293fe977b262865caf28a70ed1fed1c93645.zip
Find loop back edges only after empty blocks are eliminated.
llvm-svn: 61752
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Transforms/Scalar/CodeGenPrepare.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Scalar/CodeGenPrepare.cpp b/llvm/lib/Transforms/Scalar/CodeGenPrepare.cpp
index ff9d32c316d..125b0760954 100644
--- a/llvm/lib/Transforms/Scalar/CodeGenPrepare.cpp
+++ b/llvm/lib/Transforms/Scalar/CodeGenPrepare.cpp
@@ -125,12 +125,13 @@ void CodeGenPrepare::findLoopBackEdges(Function &F) {
bool CodeGenPrepare::runOnFunction(Function &F) {
bool EverMadeChange = false;
- findLoopBackEdges(F);
-
// First pass, eliminate blocks that contain only PHI nodes and an
// unconditional branch.
EverMadeChange |= EliminateMostlyEmptyBlocks(F);
+ // Now find loop back edges.
+ findLoopBackEdges(F);
+
bool MadeChange = true;
while (MadeChange) {
MadeChange = false;
OpenPOWER on IntegriCloud