[llvm] [AMDGPU][MC] update USER_SGPR_COUNT bits for GFX1250 (PR #192579)

Stanislav Mekhanoshin via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 17 11:05:02 PDT 2026


rampitec wrote:

> > According to the spec the target has 32 user SGPRs, not more.
> 
> Thanks for your comment and please correct me if I am wrong. You are right that there 32 user SGPRs and as the lit-test verifies: `.sgpr_count: 32` even though there 36 kernel arguments, all tagged hint `inreg` .
> 
> However, inside LLVM, the bits for USER_SGPR_COUNT on GFX1250 are not the same as the document https://llvm.org/docs/AMDGPUUsage.html#amdgpu-amdhsa-compute-pgm-rsrc2-gfx6-gfx12-table and it causes `llvm-mc` to bail out if the number of kernel arguments is beyond 32.
> 
> As for the problem in the triton kernel, I guess they want to optimize preloaded kernel arguments, from the [Preloaded Kernel Argument](https://llvm.org/docs/AMDGPUUsage.html#preloaded-kernel-arguments) section, but it might the next question: how to use firmware to hold all kernel arguments.

Apparently we have updated COMPUTE_PGM_RSRC2_GFX125_USER_SGPR_COUNT and other places, but forgot this one. Yet 6 bits are needed to hold the values in range [0..32], but any higher number cannot be used and it is an error to do so.

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


More information about the llvm-commits mailing list