[llvm] [AA] Improve precision for monotonic atomic load/store operations (PR #158169)
Jin Huang via llvm-commits
llvm-commits at lists.llvm.org
Mon Sep 15 10:17:40 PDT 2025
================
@@ -457,8 +465,15 @@ ModRefInfo AAResults::getModRefInfo(const StoreInst *S,
return ModRefInfo::NoModRef;
}
+ // At this point, the store's ordering is at most `Monotonic` (i.e.,
+ // Monotonic, Unordered, or non-atomic), and it aliases with `Loc`. The
+ // condition `isStrongerThan(S->getOrdering(), AtomicOrdering::Unordered)` is
+ // true only for `Monotonic` stores.
+ if (isStrongerThan(S->getOrdering(), AtomicOrdering::Unordered))
+ return ModRefInfo::ModRef;
----------------
jinhuang1102 wrote:
I think both the if block and the code following it return ModRefInfo::ModRef. This makes the condition and the first return statement redundant. I remove this if condition to check if the Atomic ordering is stronger than unordered. Please let me know your comment (@nikic ). Thanks.
https://github.com/llvm/llvm-project/pull/158169
More information about the llvm-commits
mailing list