[clang] [llvm] [SPIR-V] Encode Atomic metadata as UserSemantic string decoration (PR #193019)

Nick Sarnie via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 21 07:21:13 PDT 2026


================
@@ -2539,6 +2539,28 @@ void SPIRVEmitIntrinsics::insertSpirvDecorations(Instruction *I,
                       {I->getType()},
                       {I, MetadataAsValue::get(I->getContext(), MD)});
   }
+  if (I->getModule()->getTargetTriple().getVendor() == Triple::AMD &&
+      isa<AtomicRMWInst>(I)) {
+    // If present, we encode AMDGPU atomic metadata as UserSemantic string
+    // decorations, which will be parsed during reverse translation.
+    auto &Ctx = B.getContext();
+    auto *US = ConstantAsMetadata::get(
----------------
sarnex wrote:

The spec proposal was technically redacted, if you want to propose something again I can dig it up for a reference

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


More information about the cfe-commits mailing list