1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 11:02:59 +02:00

Fix PR33878: BasicAA incorrectly assumes different address spaces don't alias

Remove code that assumed that a nullptr of address space != 0 couldnt alias with a non-null pointer. This is incorrect, since nothing can be concluded about a null pointer in an address space != 0.
This code was written before address spaces were introduced

Differential Revision: https://reviews.llvm.org/D37518

llvm-svn: 312648
This commit is contained in:
Nuno Lopes 2017-09-06 16:55:31 +00:00
parent 2ab1485e52
commit 20aad04ccc

View File

@ -1590,11 +1590,6 @@ AliasResult BasicAAResult::aliasCheck(const Value *V1, uint64_t V1Size,
(isa<Argument>(O2) && isIdentifiedFunctionLocal(O1)))
return NoAlias;
// Most objects can't alias null.
if ((isa<ConstantPointerNull>(O2) && isKnownNonNull(O1)) ||
(isa<ConstantPointerNull>(O1) && isKnownNonNull(O2)))
return NoAlias;
// If one pointer is the result of a call/invoke or load and the other is a
// non-escaping local object within the same function, then we know the
// object couldn't escape to a point where the call could return it.