summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/Scalar/LoopPredication.cpp4
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;
}
OpenPOWER on IntegriCloud