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

Akshay Deodhar via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 2 09:54:22 PDT 2025


================
@@ -6317,10 +6317,13 @@ Instruction *NVPTXTargetLowering::emitLeadingFence(IRBuilderBase &Builder,
 
   // Specialize for cmpxchg
   // Emit a fence.sc leading fence for cmpxchg seq_cst which are not emulated
+  SyncScope::ID SSID = cast<AtomicCmpXchgInst>(Inst)->getSyncScopeID();
   if (isReleaseOrStronger(Ord))
-    return Ord == AtomicOrdering::SequentiallyConsistent
-               ? Builder.CreateFence(AtomicOrdering::SequentiallyConsistent)
-               : Builder.CreateFence(AtomicOrdering::Release);
+    return Builder.CreateFence(
+        Ord == AtomicOrdering::SequentiallyConsistent
+            ? AtomicOrdering::SequentiallyConsistent
+            : AtomicOrdering::Release,
----------------
akshayrdeodhar wrote:

Applied clang-format


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


More information about the llvm-commits mailing list