diff options
author | Sean Silva <chisophugis@gmail.com> | 2016-07-02 23:47:27 +0000 |
---|---|---|
committer | Sean Silva <chisophugis@gmail.com> | 2016-07-02 23:47:27 +0000 |
commit | 45835e731d41d45e92973b4845d7f75e6997cb22 (patch) | |
tree | 65974666335fc28c12461b043187889ddec4fe4e /llvm/lib/Analysis/InstructionSimplify.cpp | |
parent | e690b7a3c6b5cff7ce0e1e8824ab305f0fbad045 (diff) | |
download | bcm5719-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/InstructionSimplify.cpp')
-rw-r--r-- | llvm/lib/Analysis/InstructionSimplify.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/llvm/lib/Analysis/InstructionSimplify.cpp b/llvm/lib/Analysis/InstructionSimplify.cpp index b52ffeebe61..a41be07fcd5 100644 --- a/llvm/lib/Analysis/InstructionSimplify.cpp +++ b/llvm/lib/Analysis/InstructionSimplify.cpp @@ -1975,7 +1975,7 @@ computePointerICmp(const DataLayout &DL, const TargetLibraryInfo *TLI, RHS = RHS->stripPointerCasts(); // A non-null pointer is not equal to a null pointer. - if (llvm::isKnownNonNull(LHS, TLI) && isa<ConstantPointerNull>(RHS) && + if (llvm::isKnownNonNull(LHS) && isa<ConstantPointerNull>(RHS) && (Pred == CmpInst::ICMP_EQ || Pred == CmpInst::ICMP_NE)) return ConstantInt::get(GetCompareTy(LHS), !CmpInst::isTrueWhenEqual(Pred)); @@ -2130,10 +2130,9 @@ computePointerICmp(const DataLayout &DL, const TargetLibraryInfo *TLI, // cannot be elided. We cannot fold malloc comparison to null. Also, the // dynamic allocation call could be either of the operands. Value *MI = nullptr; - if (isAllocLikeFn(LHS, TLI) && llvm::isKnownNonNullAt(RHS, CxtI, DT, TLI)) + if (isAllocLikeFn(LHS, TLI) && llvm::isKnownNonNullAt(RHS, CxtI, DT)) MI = LHS; - else if (isAllocLikeFn(RHS, TLI) && - llvm::isKnownNonNullAt(LHS, CxtI, DT, TLI)) + else if (isAllocLikeFn(RHS, TLI) && llvm::isKnownNonNullAt(LHS, CxtI, DT)) MI = RHS; // FIXME: We should also fold the compare when the pointer escapes, but the // compare dominates the pointer escape |