[llvm] [AMDGPU] More accurately account for AVGPR pressure (PR #150711)
Lucas Ramirez via llvm-commits
llvm-commits at lists.llvm.org
Tue Aug 26 02:59:25 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:
> As you can see, it's equally as heavy as we now need to pass the MF or some other structure into the GCNRegPressure constructor, and we need to propagate this through the RPTrackers as well.
Yeah I see it's not better code-wise.
> Conceptually, I thought it was a little weird to have the RegPressure depend on this context. I suppose it makes some sense if we are just wanting to pull the ST. Passing the MF instead of ST is just a convenience for the caller.
It conceptually makes sense for me since with the introduction of AVGPR pressure tracking some RP queries really depend on the target occupancy range, which is also computed per MF.
Ultimately I don't have a strong opinion about this, please feel free to revert to what you had at the beginning if you expect it to be easier to work with.
https://github.com/llvm/llvm-project/pull/150711
More information about the llvm-commits
mailing list