[llvm] [AMDGPU] Tweak sched model latencies for VALU fast-forward cases (PR #198475)

Jay Foad via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 17 05:12:36 PDT 2026


================
@@ -865,6 +865,42 @@ void GCNSubtarget::adjustSchedDependency(
     Dep.setLatency(InstrInfo.getSchedModel().computeOperandLatency(
         DefI, DefOpIdx, UseI, UseOpIdx));
   }
+
+  // Handle "fast-forward" cases for VALU dependencies via a lanemask-like SGPR:
----------------
jayfoad wrote:

Yes absolutely but I'm not sure how to common them, and anyway the purpose is subtly different:

- This patch avoids unnecessarily pushing lanemask producer/consumer pairs away from each other.
- `shouldScheduleAdjacent` (used in the MacroFusion DAG mutation) actively tries to pull lanemask producer/consumer pairs towards each other to increase the chance of being able to allocate the lanemask to VCC.

There will be a third place handling fast-forwards when #205481 lands.

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


More information about the llvm-commits mailing list