[llvm] [AMDGPU] Add user flag to set min/max number of AGPRs. (PR #216800)

via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 18 09:05:27 PDT 2026


carlobertolli wrote:

> I don't think it's a good idea to special case occupancy >= 2. This seems like just treating the symptoms instead of the root cause. I wonder why it is a good idea not to use AGPR when occupancy >= 2?

It's a heuristic: at occupancy >=2 you don't have extra registers by just using agprs (unlike at occupancy 1), so to use them you need to have a bunch of moves from vgprs to agprs in the first place, while accumulation can happen in vgprs.

I was running a gemm experiment in HipKittens, which runs at occupancy 2, and using agprs results in a large overhead. The developers of HipKittens remedy the problem by using inline assembly and targeting vgprs explicitly, which is what I was trying to replace.

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


More information about the llvm-commits mailing list