[llvm] [AMDGPU] Ignore inactive VGPRs in .vgpr_count (PR #144855)

Diana Picus via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 4 03:00:02 PDT 2025


================
@@ -1351,6 +1351,28 @@ constexpr bool isEntryFunctionCC(CallingConv::ID CC) {
   }
 }
 
+// Shaders that are entry functions need to count input arguments even if
+// they're not used (i.e. not reported by AMDGPUResourceUsageAnalysis). Other
+// functions can skip including them. This is especially important for shaders
+// that use the init.whole.wave intrinsic, since they sometimes have VGPR
+// arguments that are only added for the purpose of preserving their inactive
+// lanes and should not be included in the vgpr-count.
+LLVM_READNONE
+constexpr bool shouldReportUnusedFuncArgs(CallingConv::ID CC) {
----------------
rovka wrote:

Ok, I get that, but the current code already treats kernels differently and changing that would cause a lot of test churn that's not related to this patch. At the moment we don't include unused VGPR arguments for kernels and I'm trying to preserve that behavior. 

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


More information about the llvm-commits mailing list