[llvm] AMDGPU/GlobalISel: RegBankLegalize rules for gfx90a/gfx942 MFMAs (PR #194076)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 27 07:13:04 PDT 2026


================
@@ -2031,21 +2032,64 @@ RegBankLegalizeRules::RegBankLegalizeRules(const GCNSubtarget &_ST,
       .Uni(S16, {{UniInVgprS16}, {IntrId, Vgpr32}})
       .Div(S16, {{Vgpr16}, {IntrId, Vgpr32}});
 
-  // TODO: Add handling for GFX90A+ which should use VGPRs instead of AGPRs.
+  // Predicates to check if we want to use the VGPR form or the AGPR form
+  // for an MFMA / SMFMAC intrinsic on gfx90a+.
+  Predicate needAGPR([](const MachineInstr &MI) -> bool {
----------------
arsenm wrote:

These rules shouldn't depend on function state (I would hope these are constructed once per subtarget, like legalizerinfo) 

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


More information about the llvm-commits mailing list