[llvm] [NVPTX] Add syncscope support for cmpxchg (PR #140812)

Akshay Deodhar via llvm-commits llvm-commits at lists.llvm.org
Fri May 30 13:49:25 PDT 2025


================
@@ -325,13 +327,18 @@ bool AtomicExpandImpl::processAtomicInstr(Instruction *I) {
       // expandAtomicCmpXchg in that case.
       FenceOrdering = CASI->getMergedOrdering();
       auto CASOrdering = TLI->atomicOperationOrderAfterFenceSplit(CASI);
+      SSID = CASI->getSyncScopeID();
 
       CASI->setSuccessOrdering(CASOrdering);
       CASI->setFailureOrdering(CASOrdering);
+      // If CAS ordering is monotonic, then the operation will
+      // take default scope. Otherwise, it will retain its scope
----------------
akshayrdeodhar wrote:

You're right, this isn't necessary.

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


More information about the llvm-commits mailing list