[llvm] [LSV] Respect atomic ordering in isSafeToMove (PR #208631)

Justin Lebar via llvm-commits llvm-commits at lists.llvm.org
Sat Jul 18 13:46:18 PDT 2026


================
@@ -609,8 +609,10 @@ ModRefInfo AAResults::getModRefInfo(const AtomicCmpXchgInst *CX,
     // If the cmpxchg address does not alias the location, it does not access
     // it.
     if (AR == AliasResult::NoAlias) {
-      // Synchronization effects may affect locations that do not alias.
-      if (isStrongerThanMonotonic(CX->getSuccessOrdering()))
+      // Synchronization effects may affect locations that do not alias.  The
+      // failure ordering counts too: it can be stronger than the success
+      // ordering (e.g. cmpxchg ... monotonic acquire).
+      if (isStrongerThanMonotonic(CX->getMergedOrdering()))
----------------
jlebar wrote:

https://github.com/llvm/llvm-project/pull/210545

https://github.com/llvm/llvm-project/pull/208631


More information about the llvm-commits mailing list