mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-23 12:24:34 +00:00
Fix test/Regression/Analysis/BasicAA/2004-07-28-MustAliasbug.llx
This also fixes the miscompilation of MallocBench/gs with dead store elimination enabled. llvm-svn: 15324
This commit is contained in:
parent
636a3a9525
commit
b2cf39d1a4
@ -322,11 +322,15 @@ BasicAliasAnalysis::alias(const Value *V1, unsigned V1Size,
|
||||
BasePtr1 = GetGEPOperands(V1, GEP1Ops);
|
||||
BasePtr2 = GetGEPOperands(V2, GEP2Ops);
|
||||
|
||||
AliasResult GAlias =
|
||||
CheckGEPInstructions(BasePtr1->getType(), GEP1Ops, V1Size,
|
||||
BasePtr2->getType(), GEP2Ops, V2Size);
|
||||
if (GAlias != MayAlias)
|
||||
return GAlias;
|
||||
// If GetGEPOperands were able to fold to the same must-aliased pointer,
|
||||
// do the comparison.
|
||||
if (BasePtr1 == BasePtr2) {
|
||||
AliasResult GAlias =
|
||||
CheckGEPInstructions(BasePtr1->getType(), GEP1Ops, V1Size,
|
||||
BasePtr2->getType(), GEP2Ops, V2Size);
|
||||
if (GAlias != MayAlias)
|
||||
return GAlias;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user