[llvm-branch-commits] [lld] [llvm] [RFC][AMDGPU][lld] Add object linking support (PR #206787)

Joseph Huber via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Wed Jul 1 05:06:23 PDT 2026


jhuber6 wrote:

> The linker's job is symbol resolution, layout, and relocation. "Compute each kernel's transitive VGPR/SGPR/LDS/scratch and re-encode compute_pgm_rsrc*" is codegen finalization, not linking.
> This makes midend/backend passes inside the ELF kinker - wrong layer.

The kernel's resource requirements are fundamentally the breadth of the call graph. When we launch a kernel we need to explicitly allocate the maximum amount of resources used by *any* function reachable by the kernel. This information is only known during the final link, so it's fundamentally a linker issue. You could theoretically punt this  to the loader, but that would add significant overhead on a very hot path and require that this metadata live in the final executable.

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


More information about the llvm-branch-commits mailing list