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

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 24 05:06:43 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) {
----------------
arsenm wrote:

Name should express the reason, not the usage context. Although here I don't understand why you're going out of your way to exclude kernels. The same reasoning should apply when using preloaded arguments 

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


More information about the llvm-commits mailing list