diff options
author | Philip Reames <listmail@philipreames.com> | 2019-06-06 18:02:36 +0000 |
---|---|---|
committer | Philip Reames <listmail@philipreames.com> | 2019-06-06 18:02:36 +0000 |
commit | 101915cfdaba9284b5bb8dedbbca2b7788f68da4 (patch) | |
tree | f100bd19831bb25c221b15533c89883a536e2afd /llvm/lib | |
parent | bd9e810b23b7907a133664a64407df3993f2426a (diff) | |
download | bcm5719-llvm-101915cfdaba9284b5bb8dedbbca2b7788f68da4.tar.gz bcm5719-llvm-101915cfdaba9284b5bb8dedbbca2b7788f68da4.zip |
[LoopPred] Fix a bug in unconditional latch bailout introduced in r362284
This is a really silly bug that even a simple test w/an unconditional latch would have caught. I tried to guard against the case, but put it in the wrong if check. Oops.
llvm-svn: 362727
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/Transforms/Scalar/LoopPredication.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Scalar/LoopPredication.cpp b/llvm/lib/Transforms/Scalar/LoopPredication.cpp index 017bf21d233..ed715d36984 100644 --- a/llvm/lib/Transforms/Scalar/LoopPredication.cpp +++ b/llvm/lib/Transforms/Scalar/LoopPredication.cpp @@ -850,7 +850,7 @@ Optional<LoopICmp> LoopPredication::parseLoopLatchICmp() { } auto *BI = dyn_cast<BranchInst>(LoopLatch->getTerminator()); - if (!BI) { + if (!BI || !BI->isConditional()) { LLVM_DEBUG(dbgs() << "Failed to match the latch terminator!\n"); return None; } @@ -860,7 +860,7 @@ Optional<LoopICmp> LoopPredication::parseLoopLatchICmp() { "One of the latch's destinations must be the header"); auto *ICI = dyn_cast<ICmpInst>(BI->getCondition()); - if (!ICI || !BI->isConditional()) { + if (!ICI) { LLVM_DEBUG(dbgs() << "Failed to match the latch condition!\n"); return None; } |