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

Diana Picus via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 2 05:54:37 PDT 2025


================
@@ -990,7 +990,10 @@ void AMDGPUAsmPrinter::getSIProgramInfo(SIProgramInfo &ProgInfo,
   // dispatch registers are function args.
   unsigned WaveDispatchNumSGPR = 0, WaveDispatchNumVGPR = 0;
 
-  if (isShader(F.getCallingConv())) {
+  // Shaders that use the init.whole.wave intrinsic sometimes have VGPR
+  // arguments that are only added for the purpose of preserving their inactive
+  // lanes. Skip including them in the VGPR count.
+  if (isShader(F.getCallingConv()) && !MFI->hasInitWholeWave()) {
----------------
rovka wrote:

I think it might cause problems for entry functions when using wave dispatch (I got this from an commit message, I don't really know how that works). But good point that I can probably make it apply to all non-entry functions.

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


More information about the llvm-commits mailing list