summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/InstCombine
diff options
context:
space:
mode:
authorNuno Lopes <nunoplopes@sapo.pt>2017-09-09 18:23:11 +0000
committerNuno Lopes <nunoplopes@sapo.pt>2017-09-09 18:23:11 +0000
commit404f106d71178d3a9f27167e6a060ad577b5fadb (patch)
treec77b721b647825ed1de4f0df7f6a51434482fcb4 /llvm/lib/Transforms/InstCombine
parent97a56866a2510f8ae3ecfde7b9d9faf444299897 (diff)
downloadbcm5719-llvm-404f106d71178d3a9f27167e6a060ad577b5fadb.tar.gz
bcm5719-llvm-404f106d71178d3a9f27167e6a060ad577b5fadb.zip
Merge isKnownNonNull into isKnownNonZero
It now knows the tricks of both functions. Also, fix a bug that considered allocas of non-zero address space to be always non null Differential Revision: https://reviews.llvm.org/D37628 llvm-svn: 312869
Diffstat (limited to 'llvm/lib/Transforms/InstCombine')
-rw-r--r--llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp b/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
index 6be0e4e3fd1..2012934dbb9 100644
--- a/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
+++ b/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
@@ -3743,7 +3743,7 @@ Instruction *InstCombiner::visitCallInst(CallInst &CI) {
return replaceInstUsesWith(*II, ConstantPointerNull::get(PT));
// isKnownNonNull -> nonnull attribute
- if (isKnownNonNullAt(DerivedPtr, II, &DT))
+ if (isKnownNonZero(DerivedPtr, DL, 0, &AC, II, &DT))
II->addAttribute(AttributeList::ReturnIndex, Attribute::NonNull);
}
@@ -3932,7 +3932,7 @@ Instruction *InstCombiner::visitCallSite(CallSite CS) {
for (Value *V : CS.args()) {
if (V->getType()->isPointerTy() &&
!CS.paramHasAttr(ArgNo, Attribute::NonNull) &&
- isKnownNonNullAt(V, CS.getInstruction(), &DT))
+ isKnownNonZero(V, DL, 0, &AC, CS.getInstruction(), &DT))
ArgNos.push_back(ArgNo);
ArgNo++;
}
OpenPOWER on IntegriCloud