[llvm] [AMDGPU] Refactor hazard recognizer for VALU-pipeline hazards. NFCI. (PR #168801)

Jay Foad via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 20 05:46:25 PST 2025


================
@@ -94,6 +98,9 @@ class GCNHazardRecognizer final : public ScheduleHazardRecognizer {
   int checkReadM0Hazards(MachineInstr *SMovRel);
   int checkNSAtoVMEMHazard(MachineInstr *MI);
   int checkFPAtomicToDenormModeHazard(MachineInstr *MI);
+  // emit V_NOP instructions. \p WaitStatesNeeded is the number of V_NOPs we
+  // need to insert, negative means not needed.
----------------
jayfoad wrote:

Seems silly to use `int` here. Zero already means "not needed" so you don't need negative values.

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


More information about the llvm-commits mailing list