[llvm] [AMDGPU] More accurately account for AVGPR pressure (PR #150711)
Lucas Ramirez via llvm-commits
llvm-commits at lists.llvm.org
Thu Aug 7 09:16:23 PDT 2025
================
@@ -99,20 +99,22 @@ void GCNRegPressure::inc(unsigned Reg,
bool GCNRegPressure::less(const MachineFunction &MF, const GCNRegPressure &O,
unsigned MaxOccupancy) const {
const GCNSubtarget &ST = MF.getSubtarget<GCNSubtarget>();
+ unsigned ArchVGPRThreshold = ST.getMaxNumVectorRegs(MF.getFunction()).first;
----------------
lucas-rami wrote:
Would it make sense to make this a class member to avoid passing it every time we call `getVGPRNum`/`getAGPRNum`? It seems to always have the value `ST.getMaxNumVectorRegs(MF.getFunction()).first` which should not change throughout the `MF`'s lifetime.
https://github.com/llvm/llvm-project/pull/150711
More information about the llvm-commits
mailing list