[llvm] r310420 - BasicAA: assert on another case where aliasGEP shouldn't get a PartialAlias response

Nuno Lopes via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 8 14:25:27 PDT 2017


Author: nlopes
Date: Tue Aug  8 14:25:26 2017
New Revision: 310420

URL: http://llvm.org/viewvc/llvm-project?rev=310420&view=rev
Log:
BasicAA: assert on another case where aliasGEP shouldn't get a PartialAlias response

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=310420&r1=310419&r2=310420&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp (original)
+++ llvm/trunk/lib/Analysis/BasicAliasAnalysis.cpp Tue Aug  8 14:25:26 2017
@@ -1238,13 +1238,15 @@ AliasResult BasicAAResult::aliasGEP(cons
     AliasResult R = aliasCheck(UnderlyingV1, MemoryLocation::UnknownSize,
                                AAMDNodes(), V2, MemoryLocation::UnknownSize,
                                V2AAInfo, nullptr, UnderlyingV2);
-    if (R != MustAlias)
+    if (R != MustAlias) {
       // If V2 may alias GEP base pointer, conservatively returns MayAlias.
       // If V2 is known not to alias GEP base pointer, then the two values
       // cannot alias per GEP semantics: "Any memory access must be done through
       // a pointer value associated with an address range of the memory access,
       // otherwise the behavior is undefined.".
+      assert(R == NoAlias || R == MayAlias);
       return R;
+    }
 
     // If the max search depth is reached the result is undefined
     if (GEP1MaxLookupReached)




More information about the llvm-commits mailing list