[llvm] [AMDGPU] Prioritize allocation of low 256 VGPR classes (PR #167978)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 13 15:59:06 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));
----------------
arsenm wrote:

Did you try setting CostPerUse? I think that makes more sense than changing priority 

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


More information about the llvm-commits mailing list