[llvm] [AMDGPU] Prioritize allocation of low 256 VGPR classes (PR #167978)
Stanislav Mekhanoshin via llvm-commits
llvm-commits at lists.llvm.org
Sat Nov 15 02:38:47 PST 2025
================
@@ -644,7 +644,7 @@ def VGPR_32_Lo128 : SIRegisterClass<"AMDGPU", !listconcat(Reg32Types.types, Reg1
// Identical to VGPR_32 except it only contains the low 256 (Lo256) registers.
def VGPR_32_Lo256 : SIRegisterClass<"AMDGPU", !listconcat(Reg32Types.types, Reg16Types.types), 32,
(add (sequence "VGPR%u", 0, 255))> {
- let AllocationPriority = 0;
+ let AllocationPriority = !add(3, !mul(BaseClassPriority, BaseClassScaleFactor));
----------------
rampitec wrote:
More or less that would make almost everything worse. Setting CostPerUse to non-zero for all low 256 VGPRs will persuade RA to allocate registers above 256 by default. At the end you will have programs using registers starting just from v256 and nothing at the range v0-v255.
https://github.com/llvm/llvm-project/pull/167978
More information about the llvm-commits
mailing list