- Fix BasicAA to correctly detect the non-aliasness of A[1] & A[2]

llvm-svn: 5518
This commit is contained in:
Chris Lattner 2003-02-09 19:27:21 +00:00
parent 117a27d291
commit f3627e3ee3

View 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;
}