[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 13:56:44 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:

Sure, that's not hard to do. I guess that an s_setreg before each function call is not too expensive (?) and could be elided if we know the callee and know that it also uses expert mode.

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


More information about the llvm-commits mailing list