aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Analysis/BasicAliasAnalysis.cpp
diff options
context:
space:
mode:
authorDavid Green <david.green@arm.com>2024-01-16 09:22:20 +0000
committerGitHub <noreply@github.com>2024-01-16 09:22:20 +0000
commitd69efa4015ca41746b1aa517976cc376bce48860 (patch)
tree9ac22c664a4e2b25f2702f1f2c574c29b1abd8ca /llvm/lib/Analysis/BasicAliasAnalysis.cpp
parent01f4d40aad58c5c34a8ae30edbf4e0ebbf235838 (diff)
downloadllvm-d69efa4015ca41746b1aa517976cc376bce48860.zip
llvm-d69efa4015ca41746b1aa517976cc376bce48860.tar.gz
llvm-d69efa4015ca41746b1aa517976cc376bce48860.tar.bz2
[BasicAA] Handle disjoint or as add in DecomposeGEP. (#78209)
This removes the MaskedValueIsZero check in decomposing geps in BasicAA, using the isDisjoint flags instead. This relies on the disjoint flags being present when AA is ran. The alternative would be to keep the old MaskedValueIsZero check too if this causes issues.
Diffstat (limited to 'llvm/lib/Analysis/BasicAliasAnalysis.cpp')
-rw-r--r--llvm/lib/Analysis/BasicAliasAnalysis.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/llvm/lib/Analysis/BasicAliasAnalysis.cpp b/llvm/lib/Analysis/BasicAliasAnalysis.cpp
index a4a0846..ab1ab10 100644
--- a/llvm/lib/Analysis/BasicAliasAnalysis.cpp
+++ b/llvm/lib/Analysis/BasicAliasAnalysis.cpp
@@ -393,10 +393,8 @@ static LinearExpression GetLinearExpression(
// further.
return Val;
case Instruction::Or:
- // X|C == X+C if all the bits in C are unset in X. Otherwise we can't
- // analyze it.
- if (!MaskedValueIsZero(BOp->getOperand(0), RHSC->getValue(),
- SimplifyQuery(DL, DT, AC, BOp)))
+ // X|C == X+C if it is disjoint. Otherwise we can't analyze it.
+ if (!cast<PossiblyDisjointInst>(BOp)->isDisjoint())
return Val;
[[fallthrough]];