diff options
author | Evan Cheng <evan.cheng@apple.com> | 2009-01-05 21:17:27 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2009-01-05 21:17:27 +0000 |
commit | 6bfbe8117f9bc3d9a0f8f11641de1a1054fac238 (patch) | |
tree | 3d5c63a08b7725f7d0327f9e3d77940d3e0ca73c /lib/Transforms | |
parent | f6757a87744a9172043f684a187f8db2689a63c9 (diff) | |
download | external_llvm-6bfbe8117f9bc3d9a0f8f11641de1a1054fac238.zip external_llvm-6bfbe8117f9bc3d9a0f8f11641de1a1054fac238.tar.gz external_llvm-6bfbe8117f9bc3d9a0f8f11641de1a1054fac238.tar.bz2 |
Find loop back edges only after empty blocks are eliminated.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61752 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms')
-rw-r--r-- | lib/Transforms/Scalar/CodeGenPrepare.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/Transforms/Scalar/CodeGenPrepare.cpp b/lib/Transforms/Scalar/CodeGenPrepare.cpp index ff9d32c..125b076 100644 --- a/lib/Transforms/Scalar/CodeGenPrepare.cpp +++ b/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; |