[llvm] [AMDGPU] Register allocation anti-hints to reduce MFMA hazard NOPs (PR #156943)

Syadus Sefat via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 7 18:53:50 PDT 2025


================
@@ -248,6 +254,95 @@ bool GCNPreRAOptimizationsImpl::run(MachineFunction &MF) {
 
   bool Changed = false;
 
+  // Single pass implementation
+  if (EnableAntiHintsForMFMARegs && ST.hasMAIInsts()) {
+    // Max lookback window for RAW or WAW hazard
+    constexpr unsigned MaxLookbackWindow = 19;
+    for (const MachineBasicBlock &MBB : MF) {
+
----------------
mssefat wrote:

Fixed it. Please check.

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


More information about the llvm-commits mailing list