[llvm] [AMDGPU] Avoid wmma bank conflict for GFX11 and GFX12 (PR #205530)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 24 04:32:32 PDT 2026


================
@@ -617,6 +617,19 @@ class SIMachineFunctionInfo final : public AMDGPUMachineFunctionInfo,
   // load/store is enabled.
   IndexedMap<uint32_t, VGPRBlock2IndexFunctor> MaskForVGPRBlockOps;
 
+  // Maps each virtual register that is an operand of a bank-sensitive v_wmma_*
+  // (matrix sources a multiple of 128 bits) to that instruction's other operand
+  // registers. Populated once by GCNPreRAOptimizations and consumed by
+  // SIRegisterInfo::getRegAllocationHints for VGPR bank-conflict avoidance, so
+  // the hint hook does not rescan the function for every virtual register.
+  DenseMap<Register, SmallVector<Register, 3>> WMMABankSiblings;
+
+  // Peak ArchVGPR pressure of the function (the "actual demand"), computed once
+  // by GCNPreRAOptimizations. Used by the WMMA bank hint to anchor its reserved
+  // bank regions to the top of the real footprint instead of the top of the
+  // whole VGPR file, so it does not inflate the VGPR count of small kernels.
+  unsigned WMMAPeakVGPRPressure = 0;
----------------
arsenm wrote:

Should try to avoid adding new fields here, especially given they are missing serialization 

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


More information about the llvm-commits mailing list