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

Sebastian Neubauer via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 2 06:14:56 PDT 2025


================
@@ -4255,10 +4255,9 @@ same *vendor-name*.
                                                                   wavefront for
                                                                   GFX6-GFX9. A register
                                                                   is required if it is
-                                                                  used explicitly, or
+                                                                  written to, or
----------------
Flakebi wrote:

That’s kinda connected to my second comment ;) I think the only place where we can have reads of registers that are never defined by an explicit write is for arguments of hw entrypoints (`amgdpu_cs`, `amdgpu_kernel`, `amdgpu_ps`, etc.).
So, we should consider arguments as used for these calling conventions.
Everywhere else, I agree, we don’t need to look at reads or anything.

I guess the `written to` in the docs can be considered good enough, as kernel/shader arguments are written to by the hardware, it’s just not visible in the shader code.

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


More information about the llvm-commits mailing list