================
@@ -2928,18 +2928,19 @@ bool
SPIRVInstructionSelector::selectBarrierInst(MachineInstr &I,
"Device Scope must set UniformMemory and ImageMemory semantic "
"in Barrier instruction");
- Register MemSemReg = buildI32Constant(MemSem, I);
- Register ScopeReg = buildI32Constant(Scope, I);
MachineBasicBlock &BB = *I.getParent();
- auto MI =
- BuildMI(BB, I, I.getDebugLoc(), TII.get(BarrierType)).addUse(ScopeReg);
+ auto MI = BuildMI(BB, I, I.getDebugLoc(), TII.get(BarrierType));
// OpControlBarrier needs to also set Execution Scope
if (WithGroupSync) {
- MI.addUse(ScopeReg);
+ Register ExecReg = buildI32Constant(SPIRV::Scope::Workgroup, I);
+ MI.addUse(ExecReg);
----------------
KungFuDonkey wrote:
This used to be fine for group memory barrier, which defines the scope twice
for work group (once for exec scope and once for memory scope). With the
addition of the other barriers, the exec scope is now always workgroup
(WithGroupSync), and the memory scope can differ from Device
(DeviceMemoryBarrier, AllMemoryBarrier) to Workgroup (GroupMemoryBarrier)
https://github.com/llvm/llvm-project/pull/190633
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits