diff options
author | Nikita Popov <nikita.ppv@gmail.com> | 2021-10-07 22:06:53 +0200 |
---|---|---|
committer | Nikita Popov <nikita.ppv@gmail.com> | 2021-10-07 22:08:41 +0200 |
commit | c77a5c21bbf061bdfdfa90a62aa60679c5810306 (patch) | |
tree | 603ac8909433a81720129b6a01dc9491a8605388 /llvm/lib/Analysis/BasicAliasAnalysis.cpp | |
parent | 417f8ea4baba9d577f5018ea211f50d3be21a54f (diff) | |
download | llvm-c77a5c21bbf061bdfdfa90a62aa60679c5810306.zip llvm-c77a5c21bbf061bdfdfa90a62aa60679c5810306.tar.gz llvm-c77a5c21bbf061bdfdfa90a62aa60679c5810306.tar.bz2 |
[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.
Diffstat (limited to 'llvm/lib/Analysis/BasicAliasAnalysis.cpp')
-rw-r--r-- | llvm/lib/Analysis/BasicAliasAnalysis.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/llvm/lib/Analysis/BasicAliasAnalysis.cpp b/llvm/lib/Analysis/BasicAliasAnalysis.cpp index 6064bd6..84e7683 100644 --- a/llvm/lib/Analysis/BasicAliasAnalysis.cpp +++ b/llvm/lib/Analysis/BasicAliasAnalysis.cpp @@ -1168,14 +1168,14 @@ AliasResult BasicAAResult::aliasGEP( // For GEPs with identical offsets, we can preserve the size and AAInfo // when performing the alias check on the underlying objects. if (DecompGEP1.Offset == 0 && DecompGEP1.VarIndices.empty()) - return getBestAAResults().alias( - MemoryLocation(UnderlyingV1, V1Size), - MemoryLocation(UnderlyingV2, V2Size), AAQI); + return getBestAAResults().alias(MemoryLocation(DecompGEP1.Base, V1Size), + MemoryLocation(DecompGEP2.Base, V2Size), + AAQI); // Do the base pointers alias? AliasResult BaseAlias = getBestAAResults().alias( - MemoryLocation::getBeforeOrAfter(UnderlyingV1), - MemoryLocation::getBeforeOrAfter(UnderlyingV2), AAQI); + MemoryLocation::getBeforeOrAfter(DecompGEP1.Base), + MemoryLocation::getBeforeOrAfter(DecompGEP2.Base), AAQI); // If we get a No or May, then return it immediately, no amount of analysis // will improve this situation. |