[llvm] [AMDGPU] Add support for GFX12 expert scheduling mode 2 (PR #170319)

Jay Foad via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 12 06:48:53 PST 2025


================
@@ -2741,7 +2979,14 @@ bool SIInsertWaitcnts::run(MachineFunction &MF) {
   AMDGPU::IsaVersion IV = AMDGPU::getIsaVersion(ST->getCPU());
 
   if (ST->hasExtendedWaitCounts()) {
-    MaxCounter = NUM_EXTENDED_INST_CNTS;
+    if (ST->hasSoftwareHazardMode() &&
+        (MF.getFunction()
+             .getFnAttribute("amdgpu-software-hazard-mode")
----------------
jayfoad wrote:

At the hardware level it's a bit in the wave state register SCHED_MODE. In theory shader code could flip this bit whenever it likes, but the compiler only supports setting it once at the start of an entry function and leaving it set for the whole call graph. So yes disjoint call graphs with different settings could work.

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


More information about the llvm-commits mailing list