[BasicAA] Use base of decomposed GEP in recursive queries (NFC)
DecompGEP.Base and UnderlyingV are currently always the same. However, logically DecompGEP.Base is the right value to use here, because the decomposed offset is relative to that base.
This commit is contained in:
parent
417f8ea4ba
commit
c77a5c21bb
|
@ -1168,14 +1168,14 @@ AliasResult BasicAAResult::aliasGEP(
|
||||||
// For GEPs with identical offsets, we can preserve the size and AAInfo
|
// For GEPs with identical offsets, we can preserve the size and AAInfo
|
||||||
// when performing the alias check on the underlying objects.
|
// when performing the alias check on the underlying objects.
|
||||||
if (DecompGEP1.Offset == 0 && DecompGEP1.VarIndices.empty())
|
if (DecompGEP1.Offset == 0 && DecompGEP1.VarIndices.empty())
|
||||||
return getBestAAResults().alias(
|
return getBestAAResults().alias(MemoryLocation(DecompGEP1.Base, V1Size),
|
||||||
MemoryLocation(UnderlyingV1, V1Size),
|
MemoryLocation(DecompGEP2.Base, V2Size),
|
||||||
MemoryLocation(UnderlyingV2, V2Size), AAQI);
|
AAQI);
|
||||||
|
|
||||||
// Do the base pointers alias?
|
// Do the base pointers alias?
|
||||||
AliasResult BaseAlias = getBestAAResults().alias(
|
AliasResult BaseAlias = getBestAAResults().alias(
|
||||||
MemoryLocation::getBeforeOrAfter(UnderlyingV1),
|
MemoryLocation::getBeforeOrAfter(DecompGEP1.Base),
|
||||||
MemoryLocation::getBeforeOrAfter(UnderlyingV2), AAQI);
|
MemoryLocation::getBeforeOrAfter(DecompGEP2.Base), AAQI);
|
||||||
|
|
||||||
// If we get a No or May, then return it immediately, no amount of analysis
|
// If we get a No or May, then return it immediately, no amount of analysis
|
||||||
// will improve this situation.
|
// will improve this situation.
|
||||||
|
|
Loading…
Reference in New Issue