================
@@ -1261,12 +1258,16 @@ bool Instruction::maySynchronize() const {
     return FI->getSyncScopeID() != SyncScope::SingleThread;
   }
   case Instruction::AtomicRMW:
-  case Instruction::AtomicCmpXchg:
-    return true;
+    return isStrongerThanMonotonic(cast<AtomicRMWInst>(this)->getOrdering());
+  case Instruction::AtomicCmpXchg: {
+    auto *ACXI = cast<AtomicCmpXchgInst>(this);
+    return isStrongerThanMonotonic(ACXI->getSuccessOrdering()) ||
+           isStrongerThanMonotonic(ACXI->getFailureOrdering());
----------------
nikic wrote:

Could check getMergedOrdering instead.

https://github.com/llvm/llvm-project/pull/230299
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to