[llvm] r312648 - Fix PR33878: BasicAA incorrectly assumes different address spaces don't alias
Nuno Lopes via llvm-commits
llvm-commits at lists.llvm.org
Wed Sep 6 09:55:31 PDT 2017
Author: nlopes
Date: Wed Sep 6 09:55:31 2017
New Revision: 312648
URL: http://llvm.org/viewvc/llvm-project?rev=312648&view=rev
Log:
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
Modified:
llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp
Modified: llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp?rev=312648&r1=312647&r2=312648&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp (original)
+++ llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp Wed Sep 6 09:55:31 2017
@@ -1590,11 +1590,6 @@ AliasResult BasicAAResult::aliasCheck(co
(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.
More information about the llvm-commits
mailing list