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

Steven Perron via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 10 07:04:16 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:

You're right. There is a named metadata that you could look up, but to get the vulkan memory model working we'll have to do more design work. That is out of scope for what you are doing.

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


More information about the llvm-commits mailing list