diff options
author | Yingwei Zheng <dtcxzyw2333@gmail.com> | 2023-10-16 04:40:10 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-16 04:40:10 +0800 |
commit | ea4cc2007efeaf14b8a07b967cb0c570e5b59d7c (patch) | |
tree | f07a716ec186483c5d8865c80302dbcf8d3234e2 /llvm/lib/Analysis/BasicAliasAnalysis.cpp | |
parent | 96196e25fd49e3d0ecec9550e81365ce122679cb (diff) | |
download | llvm-ea4cc2007efeaf14b8a07b967cb0c570e5b59d7c.zip llvm-ea4cc2007efeaf14b8a07b967cb0c570e5b59d7c.tar.gz llvm-ea4cc2007efeaf14b8a07b967cb0c570e5b59d7c.tar.bz2 |
[BasicAA] Remove NSW flags when merging scales (#69122)
When merging scales of `LinearExpression` that have common index
variables, we cannot guarantee the NSW flag still applies to the merged
expression.
Fixes #69096.
Diffstat (limited to 'llvm/lib/Analysis/BasicAliasAnalysis.cpp')
-rw-r--r-- | llvm/lib/Analysis/BasicAliasAnalysis.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/llvm/lib/Analysis/BasicAliasAnalysis.cpp b/llvm/lib/Analysis/BasicAliasAnalysis.cpp index c162b8f..ca65abe 100644 --- a/llvm/lib/Analysis/BasicAliasAnalysis.cpp +++ b/llvm/lib/Analysis/BasicAliasAnalysis.cpp @@ -662,6 +662,7 @@ BasicAAResult::DecomposeGEPExpression(const Value *V, const DataLayout &DL, if (Decomposed.VarIndices[i].Val.V == LE.Val.V && Decomposed.VarIndices[i].Val.hasSameCastsAs(LE.Val)) { Scale += Decomposed.VarIndices[i].Scale; + LE.IsNSW = false; // We cannot guarantee nsw for the merge. Decomposed.VarIndices.erase(Decomposed.VarIndices.begin() + i); break; } |