diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2013-09-24 16:37:51 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2013-09-24 16:37:51 +0000 |
commit | 6629210aaf9d2e4fcbecc80b35f72108304da4b4 (patch) | |
tree | 9e5c76565a5c82aaaabbee0fab814c018ca838d2 /lib/Analysis/InstructionSimplify.cpp | |
parent | d721520e4c5d8ad71310a34727a567c3d74e7c08 (diff) | |
download | external_llvm-6629210aaf9d2e4fcbecc80b35f72108304da4b4.zip external_llvm-6629210aaf9d2e4fcbecc80b35f72108304da4b4.tar.gz external_llvm-6629210aaf9d2e4fcbecc80b35f72108304da4b4.tar.bz2 |
Teach MemoryBuiltins and InstructionSimplify that operator new never returns NULL.
This is safe per C++11 18.6.1.1p3: [operator new returns] a non-null pointer to
suitably aligned storage (3.7.4), or else throw a bad_alloc exception. This
requirement is binding on a replacement version of this function.
Brings us a tiny bit closer to eliminating more vector push_backs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191310 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/InstructionSimplify.cpp')
-rw-r--r-- | lib/Analysis/InstructionSimplify.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Analysis/InstructionSimplify.cpp b/lib/Analysis/InstructionSimplify.cpp index af65cb7..b867af1 100644 --- a/lib/Analysis/InstructionSimplify.cpp +++ b/lib/Analysis/InstructionSimplify.cpp @@ -1739,7 +1739,7 @@ static Constant *computePointerICmp(const DataLayout *TD, RHS = RHS->stripPointerCasts(); // A non-null pointer is not equal to a null pointer. - if (llvm::isKnownNonNull(LHS) && isa<ConstantPointerNull>(RHS) && + if (llvm::isKnownNonNull(LHS, TLI) && isa<ConstantPointerNull>(RHS) && (Pred == CmpInst::ICMP_EQ || Pred == CmpInst::ICMP_NE)) return ConstantInt::get(GetCompareTy(LHS), !CmpInst::isTrueWhenEqual(Pred)); |