[llvm] [AMDGPU] Skip register uses in AMDGPUResourceUsageAnalysis (PR #133242)

Diana Picus via llvm-commits llvm-commits at lists.llvm.org
Thu May 22 00:33:43 PDT 2025


================
@@ -974,6 +974,19 @@ class SIMachineFunctionInfo final : public AMDGPUMachineFunction,
     return NumUserSGPRs + NumSystemSGPRs;
   }
 
+  unsigned getNumPreloadedVGPRs() const {
----------------
rovka wrote:

> Does this need to handle all the other things that can get preloaded in VGPRs for graphics shaders? Or can you comment (or assert) that it is only for compute shaders?

Graphics has special handling in AMDGPUAsmPrinter (so I think the final .vgpr_count should be correct). I'm tot sure if it's trivial to move it here. I'll have a look.

> Does this correctly handle the way that workitemidx/y/z are all packed into v0 in GFX11+?

Yes, there's a test for that in vgpr-count-compute.ll :)

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


More information about the llvm-commits mailing list