summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Scalar/JumpThreading.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Transforms/Scalar/JumpThreading.cpp')
-rw-r--r--llvm/lib/Transforms/Scalar/JumpThreading.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Scalar/JumpThreading.cpp b/llvm/lib/Transforms/Scalar/JumpThreading.cpp
index ab83553f81b..6ab00ee2b19 100644
--- a/llvm/lib/Transforms/Scalar/JumpThreading.cpp
+++ b/llvm/lib/Transforms/Scalar/JumpThreading.cpp
@@ -895,12 +895,14 @@ bool JumpThreading::ProcessImpliedCondition(BasicBlock *BB) {
BasicBlock *CurrentPred = BB->getSinglePredecessor();
unsigned Iter = 0;
+ auto &DL = BB->getModule()->getDataLayout();
+
while (CurrentPred && Iter++ < ImplicationSearchThreshold) {
auto *PBI = dyn_cast<BranchInst>(CurrentPred->getTerminator());
if (!PBI || !PBI->isConditional() || PBI->getSuccessor(0) != CurrentBB)
return false;
- if (isImpliedCondition(PBI->getCondition(), Cond)) {
+ if (isImpliedCondition(PBI->getCondition(), Cond, DL)) {
BI->getSuccessor(1)->removePredecessor(BB);
BranchInst::Create(BI->getSuccessor(0), BI);
BI->eraseFromParent();
OpenPOWER on IntegriCloud