diff options
author | Larisse Voufo <lvoufo@google.com> | 2015-09-18 19:14:35 +0000 |
---|---|---|
committer | Larisse Voufo <lvoufo@google.com> | 2015-09-18 19:14:35 +0000 |
commit | 532bf7153c8bba03f7d39449398130ee81b828cc (patch) | |
tree | aa12f99a0e9e98b6f20395e151aa14313bbae56e /llvm/lib/Transforms/InstCombine | |
parent | c4b28a8f741918b10b0a7211ccba288658e8e043 (diff) | |
download | bcm5719-llvm-532bf7153c8bba03f7d39449398130ee81b828cc.tar.gz bcm5719-llvm-532bf7153c8bba03f7d39449398130ee81b828cc.zip |
Clean up: Refactoring the hardcoded value of 6 for FindAvailableLoadedValue()'s parameter MaxInstsToScan. (Complete version of r247497. See D12886)
llvm-svn: 248022
Diffstat (limited to 'llvm/lib/Transforms/InstCombine')
-rw-r--r-- | llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp b/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp index 3c70f442647..30478f4e7d0 100644 --- a/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp +++ b/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp @@ -750,8 +750,9 @@ Instruction *InstCombiner::visitLoadInst(LoadInst &LI) { // separated by a few arithmetic operations. BasicBlock::iterator BBI = &LI; AAMDNodes AATags; - if (Value *AvailableVal = FindAvailableLoadedValue(Op, LI.getParent(), BBI, - 6, AA, &AATags)) { + if (Value *AvailableVal = + FindAvailableLoadedValue(Op, LI.getParent(), BBI, + DefMaxInstsToScan, AA, &AATags)) { if (LoadInst *NLI = dyn_cast<LoadInst>(AvailableVal)) { unsigned KnownIDs[] = { LLVMContext::MD_tbaa, @@ -822,7 +823,7 @@ Instruction *InstCombiner::visitLoadInst(LoadInst &LI) { } // load (select (cond, null, P)) -> load P - if (isa<ConstantPointerNull>(SI->getOperand(1)) && + if (isa<ConstantPointerNull>(SI->getOperand(1)) && LI.getPointerAddressSpace() == 0) { LI.setOperand(0, SI->getOperand(2)); return &LI; |