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 | 7e66c0d43aefce78948f0b73422f6e5bb28e2077 (patch) | |
tree | 3d5c63a08b7725f7d0327f9e3d77940d3e0ca73c /lib/Transforms/Scalar/CodeGenPrepare.cpp | |
parent | c6c22e25425b41b9b3f84682c5188ce585b1eab3 (diff) | |
download | llvm-7e66c0d43aefce78948f0b73422f6e5bb28e2077.tar.gz llvm-7e66c0d43aefce78948f0b73422f6e5bb28e2077.tar.bz2 llvm-7e66c0d43aefce78948f0b73422f6e5bb28e2077.tar.xz |
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/Scalar/CodeGenPrepare.cpp')
-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 ff9d32c316..125b076095 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; |