summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/ValueTracking.cpp
diff options
context:
space:
mode:
authorSean Silva <chisophugis@gmail.com>2016-07-02 23:47:27 +0000
committerSean Silva <chisophugis@gmail.com>2016-07-02 23:47:27 +0000
commit45835e731d41d45e92973b4845d7f75e6997cb22 (patch)
tree65974666335fc28c12461b043187889ddec4fe4e /llvm/lib/Analysis/ValueTracking.cpp
parente690b7a3c6b5cff7ce0e1e8824ab305f0fbad045 (diff)
downloadbcm5719-llvm-45835e731d41d45e92973b4845d7f75e6997cb22.tar.gz
bcm5719-llvm-45835e731d41d45e92973b4845d7f75e6997cb22.zip
Remove dead TLI arg of isKnownNonNull and propagate deadness. NFC.
This actually uncovered a surprisingly large chain of ultimately unused TLI args. From what I can gather, this argument is a remnant of when isKnownNonNull would look at the TLI directly. The current approach seems to be that InferFunctionAttrs runs early in the pipeline and uses TLI to annotate the TLI-dependent non-null information as return attributes. This also removes the dependence of functionattrs on TLI altogether. llvm-svn: 274455
Diffstat (limited to 'llvm/lib/Analysis/ValueTracking.cpp')
-rw-r--r--llvm/lib/Analysis/ValueTracking.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/llvm/lib/Analysis/ValueTracking.cpp b/llvm/lib/Analysis/ValueTracking.cpp
index 16dd3078160..a059b76d808 100644
--- a/llvm/lib/Analysis/ValueTracking.cpp
+++ b/llvm/lib/Analysis/ValueTracking.cpp
@@ -3052,8 +3052,7 @@ bool llvm::onlyUsedByLifetimeMarkers(const Value *V) {
bool llvm::isSafeToSpeculativelyExecute(const Value *V,
const Instruction *CtxI,
- const DominatorTree *DT,
- const TargetLibraryInfo *TLI) {
+ const DominatorTree *DT) {
const Operator *Inst = dyn_cast<Operator>(V);
if (!Inst)
return false;
@@ -3104,8 +3103,8 @@ bool llvm::isSafeToSpeculativelyExecute(const Value *V,
Attribute::SanitizeAddress))
return false;
const DataLayout &DL = LI->getModule()->getDataLayout();
- return isDereferenceableAndAlignedPointer(
- LI->getPointerOperand(), LI->getAlignment(), DL, CtxI, DT, TLI);
+ return isDereferenceableAndAlignedPointer(LI->getPointerOperand(),
+ LI->getAlignment(), DL, CtxI, DT);
}
case Instruction::Call: {
if (const IntrinsicInst *II = dyn_cast<IntrinsicInst>(Inst)) {
@@ -3190,7 +3189,7 @@ bool llvm::mayBeMemoryDependent(const Instruction &I) {
}
/// Return true if we know that the specified value is never null.
-bool llvm::isKnownNonNull(const Value *V, const TargetLibraryInfo *TLI) {
+bool llvm::isKnownNonNull(const Value *V) {
assert(V->getType()->isPointerTy() && "V must be pointer type");
// Alloca never returns null, malloc might.
@@ -3257,8 +3256,8 @@ static bool isKnownNonNullFromDominatingCondition(const Value *V,
}
bool llvm::isKnownNonNullAt(const Value *V, const Instruction *CtxI,
- const DominatorTree *DT, const TargetLibraryInfo *TLI) {
- if (isKnownNonNull(V, TLI))
+ const DominatorTree *DT) {
+ if (isKnownNonNull(V))
return true;
return CtxI ? ::isKnownNonNullFromDominatingCondition(V, CtxI, DT) : false;
OpenPOWER on IntegriCloud