diff options
author | Dan Gohman <gohman@apple.com> | 2009-11-05 21:48:32 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2009-11-05 21:48:32 +0000 |
commit | 928068a8864e423d1fc26a4e4c72d065746e9548 (patch) | |
tree | 0a729be615321432ccf06cdb534537fc0155a564 /llvm/lib/Transforms/Utils/LoopSimplify.cpp | |
parent | dca7ac335b1432091a3f11155c78855ffa920768 (diff) | |
download | llvm-928068a8864e423d1fc26a4e4c72d065746e9548.zip llvm-928068a8864e423d1fc26a4e4c72d065746e9548.tar.gz llvm-928068a8864e423d1fc26a4e4c72d065746e9548.tar.bz2 |
Avoid calling getUniqueExitBlocks from within LoopSimplify, as it depends
on loops having dedicated exits, which LoopSimplify can no longer always
guarantee.
llvm-svn: 86181
Diffstat (limited to 'llvm/lib/Transforms/Utils/LoopSimplify.cpp')
-rw-r--r-- | llvm/lib/Transforms/Utils/LoopSimplify.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Utils/LoopSimplify.cpp b/llvm/lib/Transforms/Utils/LoopSimplify.cpp index 63708b1..2ab0972 100644 --- a/llvm/lib/Transforms/Utils/LoopSimplify.cpp +++ b/llvm/lib/Transforms/Utils/LoopSimplify.cpp @@ -241,7 +241,14 @@ ReprocessLoop: // loop-invariant instructions out of the way to open up more // opportunities, and the disadvantage of having the responsibility // to preserve dominator information. - if (ExitBlocks.size() > 1 && L->getUniqueExitBlock()) { + bool UniqueExit = true; + if (!ExitBlocks.empty()) + for (unsigned i = 1, e = ExitBlocks.size(); i != e; ++i) + if (ExitBlocks[i] != ExitBlocks[0]) { + UniqueExit = false; + break; + } + if (UniqueExit) { SmallVector<BasicBlock*, 8> ExitingBlocks; L->getExitingBlocks(ExitingBlocks); for (unsigned i = 0, e = ExitingBlocks.size(); i != e; ++i) { |