summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Analysis/ScalarEvolution.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/Analysis/ScalarEvolution.cpp b/llvm/lib/Analysis/ScalarEvolution.cpp
index fce2a0e905f..d52c5b0276a 100644
--- a/llvm/lib/Analysis/ScalarEvolution.cpp
+++ b/llvm/lib/Analysis/ScalarEvolution.cpp
@@ -9712,8 +9712,9 @@ bool ScalarEvolution::isImpliedViaMerge(ICmpInst::Predicate Pred,
// AddRec. It means that there is a loop which has both AddRec and Unknown
// PHIs, for it we can compare incoming values of AddRec from above the loop
// and latch with their respective incoming values of LPhi.
- assert(LPhi->getNumIncomingValues() == 2 &&
- "Phi node standing in loop header does not have exactly 2 inputs?");
+ // TODO: Generalize to handle loops with many inputs in a header.
+ if (LPhi->getNumIncomingValues() != 2) return false;
+
auto *RLoop = RAR->getLoop();
auto *Predecessor = RLoop->getLoopPredecessor();
assert(Predecessor && "Loop with AddRec with no predecessor?");
OpenPOWER on IntegriCloud