]> granicus.if.org Git - llvm/commitdiff
BasicAA: aliasGEP shouldn't get a PartialAlias response here
authorNuno Lopes <nunoplopes@sapo.pt>
Tue, 8 Aug 2017 16:13:24 +0000 (16:13 +0000)
committerNuno Lopes <nunoplopes@sapo.pt>
Tue, 8 Aug 2017 16:13:24 +0000 (16:13 +0000)
add an assert() to ensure that's the case (as I'm not convinced it won't happen)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@310373 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/BasicAliasAnalysis.cpp

index e682a644ef2c1aa5c950579831f94fc3ff3071e9..9bd4349835ec8db296166a4358f4bfda6a690c22 100644 (file)
@@ -1196,8 +1196,10 @@ AliasResult BasicAAResult::aliasGEP(const GEPOperator *GEP1, uint64_t V1Size,
 
     // If we get a No or May, then return it immediately, no amount of analysis
     // will improve this situation.
-    if (BaseAlias != MustAlias)
+    if (BaseAlias != MustAlias) {
+      assert(BaseAlias == NoAlias || BaseAlias == MayAlias);
       return BaseAlias;
+    }
 
     // Otherwise, we have a MustAlias.  Since the base pointers alias each other
     // exactly, see if the computed offset from the common pointer tells us