diff options
author | Dan Gohman <gohman@apple.com> | 2009-11-05 21:47:04 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2009-11-05 21:47:04 +0000 |
commit | daf8ec35aa03cc88dc86febffce6daf1f2ba4d53 (patch) | |
tree | e05252b5e1137171e1e0db7579551f5066e8ca6a /lib/Transforms/Scalar/LoopDeletion.cpp | |
parent | 80439603bfcf5cc282adf1d4aa2e2fb0ece52bd2 (diff) | |
download | external_llvm-daf8ec35aa03cc88dc86febffce6daf1f2ba4d53.zip external_llvm-daf8ec35aa03cc88dc86febffce6daf1f2ba4d53.tar.gz external_llvm-daf8ec35aa03cc88dc86febffce6daf1f2ba4d53.tar.bz2 |
LoopDeletion depends on loops having dedicated exits.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86180 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Scalar/LoopDeletion.cpp')
-rw-r--r-- | lib/Transforms/Scalar/LoopDeletion.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/Transforms/Scalar/LoopDeletion.cpp b/lib/Transforms/Scalar/LoopDeletion.cpp index 866d8b4..48817ab 100644 --- a/lib/Transforms/Scalar/LoopDeletion.cpp +++ b/lib/Transforms/Scalar/LoopDeletion.cpp @@ -115,6 +115,10 @@ bool LoopDeletion::runOnLoop(Loop* L, LPPassManager& LPM) { if (!preheader) return false; + // If LoopSimplify form is not available, stay out of trouble. + if (!L->hasDedicatedExits()) + return false; + // We can't remove loops that contain subloops. If the subloops were dead, // they would already have been removed in earlier executions of this pass. if (L->begin() != L->end()) |