[clang] [llvm] [HLSL][DXIL][SPRIV] Added `GroupMemoryBarrier()` (PR #185383)

Steven Perron via cfe-commits cfe-commits at lists.llvm.org
Mon Mar 9 07:57:20 PDT 2026


================
@@ -2800,6 +2801,27 @@ bool SPIRVInstructionSelector::selectWaveOpInst(Register ResVReg,
   return true;
 }
 
+bool SPIRVInstructionSelector::selectBarrierInst(MachineInstr &I,
+                                                 unsigned Scope,
+                                                 bool WithGroupSync) const {
+  auto BarrierType =
+      WithGroupSync ? SPIRV::OpControlBarrier : SPIRV::OpMemoryBarrier;
+  Register MemSemReg =
+      buildI32Constant(SPIRV::MemorySemantics::SequentiallyConsistent, I);
----------------
s-perron wrote:

Can you add an assert asserting that we are not using the Vulkan memory model. This is fine for now, but at some point I want to have all spir-v targeting Vulkan assuming the Vulkan memory model. I believe it is common enough now, even on Android. I want this to be easy to find when we start looking into that.

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


More information about the cfe-commits mailing list