[llvm] AMDGPU: Select VGPR MFMAs by default (PR #159493)
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Sun Nov 16 14:41:25 PST 2025
================
@@ -37,7 +37,7 @@ static cl::opt<bool, true> MFMAVGPRFormOpt(
"amdgpu-mfma-vgpr-form",
cl::desc("Whether to force use VGPR for Opc and Dest of MFMA. If "
"unspecified, default to compiler heuristics"),
- cl::location(SIMachineFunctionInfo::MFMAVGPRForm), cl::init(false),
+ cl::location(SIMachineFunctionInfo::MFMAVGPRForm), cl::init(true),
----------------
arsenm wrote:
Eventually the flag should be removed. For now some tests are relying on it, and it's a chicken bit.
> we had a rudimentary heuristic
I wouldn't call it a heuristic. This system was always trying to just avoid register allocation failures in cases where there won't be AGPRs available. The original implementation crudely tried to detect AGPR usage by checking partially constructed MIR, and over time that became the more reliable IR attribute check
> So this flag now just overrides the amdgpu-agpr-alloc attribute?
No. amdgpu-agpr-alloc is only controlling the register budget. All of the predicates were just trying to avoid creating AGPR uses in a function that wouldn't have AGPRs available for the instruction
https://github.com/llvm/llvm-project/pull/159493
More information about the llvm-commits
mailing list