- Fix BasicAA to correctly detect the non-aliasness of A[1] & A[2]
authorChris Lattner <sabre@nondot.org>
Sun, 9 Feb 2003 19:27:21 +0000 (19:27 +0000)
committerChris Lattner <sabre@nondot.org>
Sun, 9 Feb 2003 19:27:21 +0000 (19:27 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5518 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/AliasAnalysis.cpp

index 2dbff6aa5c77dcad99a8615c4af7ee1daa381ee8..510db5700e852bbb76ecdf73d758c2f01eed1329 100644 (file)
@@ -165,7 +165,7 @@ AliasAnalysis::Result BasicAliasAnalysis::alias(const Value *V1,
   if (const Instruction *I = dyn_cast<CastInst>(V1))
     return alias(I->getOperand(0), V2);
   if (const Instruction *I = dyn_cast<CastInst>(V2))
-    return alias(I->getOperand(0), V1);
+    return alias(V1, I->getOperand(0));
 
   // If we have two gep instructions with identical indices, return an alias
   // result equal to the alias result of the original pointer...
@@ -197,7 +197,7 @@ AliasAnalysis::Result BasicAliasAnalysis::alias(const Value *V1,
         // doesn't tell us anything.
         //
         if (AllConstant &&
-            alias(GEP1->getOperand(0), GEP2->getOperand(1)) != MayAlias)
+            alias(GEP1->getOperand(0), GEP2->getOperand(0)) != MayAlias)
             return NoAlias;
       }