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

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 27 07:03:33 PDT 2025


================
@@ -239,6 +245,16 @@ AMDGPUResourceUsageAnalysis::analyzeResourceUsage(
           break;
         }
 
+        // For functions that use the llvm.amdgcn.init.whole.wave intrinsic, we
+        // often add artificial VGPR arguments for the purpose of preserving
+        // their inactive lanes. These should not be reported as part of our
+        // VGPR usage. We can identify them easily because they're only used in
+        // the chain call, and possibly in an IMPLICIT_DEF coming from an
+        // llvm.amdgcn.dead intrinsic.
+        if (IsIWWFunction && (IsChainCall || IsImplicitDef) &&
+            TRI.isVectorRegister(MRI, Reg))
+          continue;
----------------
arsenm wrote:

Doesn't matter if it's a vector register. I thought we already had a helper somewhere to skip synthetic uses 

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


More information about the llvm-commits mailing list