[PATCH] D130654: [AMDGPU] Consider S_SETPRIO a scheduling boundary

Stanislav Mekhanoshin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 27 11:34:18 PDT 2022


rampitec created this revision.
rampitec added a reviewer: kerbowa.
Herald added subscribers: kosarev, jsilvanus, foad, hiraditya, t-tye, tpr, dstuttard, yaxunl, nhaehnle, jvesely, kzhuravl, arsenm.
Herald added a project: All.
rampitec requested review of this revision.
Herald added a subscriber: wdng.
Herald added a project: LLVM.

The instruction is used to modify wave priority with the intent
to affect VALU execution and currently we can reschedule VALU
around it since that VALU does not have side effects.


https://reviews.llvm.org/D130654

Files:
  llvm/lib/Target/AMDGPU/SIInstrInfo.cpp
  llvm/test/CodeGen/AMDGPU/sched-setprio.ll


Index: llvm/test/CodeGen/AMDGPU/sched-setprio.ll
===================================================================
--- llvm/test/CodeGen/AMDGPU/sched-setprio.ll
+++ llvm/test/CodeGen/AMDGPU/sched-setprio.ll
@@ -3,13 +3,11 @@
 declare void @llvm.amdgcn.s.setprio(i16)
 declare <4 x float> @llvm.amdgcn.mfma.f32.4x4x1f32(float, float, <4 x float>, i32, i32, i32)
 
-; FIXME: setprio shall surround mfma instructions
-
 ; GCN-LABEL: {{^}}test_mfma_f32_4x4x1f32:
 ; GCN: s_setprio 1
-; GCN: s_setprio 0
 ; GCN: v_mfma
 ; GCN: v_mfma
+; GCN: s_setprio 0
 define amdgpu_kernel void @test_mfma_f32_4x4x1f32(<4 x float> addrspace(1)* %arg) #0 {
 bb:
   %in.1 = load <4 x float>, <4 x float> addrspace(1)* %arg
Index: llvm/lib/Target/AMDGPU/SIInstrInfo.cpp
===================================================================
--- llvm/lib/Target/AMDGPU/SIInstrInfo.cpp
+++ llvm/lib/Target/AMDGPU/SIInstrInfo.cpp
@@ -3489,6 +3489,7 @@
   return MI.modifiesRegister(AMDGPU::EXEC, &RI) ||
          MI.getOpcode() == AMDGPU::S_SETREG_IMM32_B32 ||
          MI.getOpcode() == AMDGPU::S_SETREG_B32 ||
+         MI.getOpcode() == AMDGPU::S_SETPRIO ||
          changesVGPRIndexingMode(MI);
 }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D130654.448108.patch
Type: text/x-patch
Size: 1181 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220727/01e4d581/attachment.bin>


More information about the llvm-commits mailing list