[llvm-branch-commits] [llvm] [AMDGPU] Report only local per-function resource usage when object linking is enabled (PR #192594)
Janek van Oirschot via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Fri Apr 17 09:28:13 PDT 2026
JanekvO wrote:
> Yes. I thought about not emitting the symbols. They are not really actively used by the linker, but they might be used by kernel descriptor.
>
Yeah, and the MsgPack stuff possibly
> I also considered deferring KD emission to the linker, but apparently KD has more fields that the linker can't really fill in, so we have to emit it here and then patch things up.
>
In my mental model of the ideal world, the KD emission would move to linker but I also acknowledge that that might require a lot more metadata to be emitted for use in the linker (which is what you're also seeing, I think).
(Sorry, digressing a bit here but: this is where I see some value in being able to emit resource info/metadata in isolation using the attributed+payloaded binary format where these additional fields can be added and emitted at an as-needed basis without needing to design a formal elf struct around it and subsequently changing said struct when extensions are needed, but perhaps there's no need for us to extend what we stuff into the obj in terms of metadata)
> However, we might be able to emit some placeholder here for those fields that will be patched by the linker at link time. WDYT?
I think patching will have to happen for cross-TU kernel descriptors to have sensible propagated metadata, yeah
To add some context on why I asked: I expected that the metadata values emission into obj would be the ones directly coming from AMDGPUResourceUsageAnalysis pass rather than the symbols so these symbols changing felt out of place for the obj linking PRs
https://github.com/llvm/llvm-project/pull/192594
More information about the llvm-branch-commits
mailing list