summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Scalar
diff options
context:
space:
mode:
authorSanjoy Das <sanjoy@playingwithpointers.com>2015-11-06 19:01:08 +0000
committerSanjoy Das <sanjoy@playingwithpointers.com>2015-11-06 19:01:08 +0000
commit55ea67cea7f9fa45fe066c8670804582ad028faa (patch)
tree3dcf6d45786fca187336ca531f7bc368dfc82e5a /llvm/lib/Transforms/Scalar
parentc01b4d2b28184d0a9efee934c8a5b7aab57984ab (diff)
downloadbcm5719-llvm-55ea67cea7f9fa45fe066c8670804582ad028faa.tar.gz
bcm5719-llvm-55ea67cea7f9fa45fe066c8670804582ad028faa.zip
[ValueTracking] Add parameters to isImpliedCondition; NFC
Summary: This change makes the `isImpliedCondition` interface similar to the rest of the functions in ValueTracking (in that it takes a DataLayout, AssumptionCache etc.). This is an NFC, intended to make a later diff less noisy. Depends on D14369 Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D14391 llvm-svn: 252333
Diffstat (limited to 'llvm/lib/Transforms/Scalar')
-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