[compiler-rt] [compiler-rt] Initial support for builtins on GPU targets (PR #95304)

Joseph Huber via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 14 10:01:45 PDT 2024


jhuber6 wrote:

> Is AMDGPU backend able to do ISA-level linking now?

AFAIK, you can do ISA-level linking in the sense that relocations work. However it's "broken" for the following reasons.
1. We don't guarantee a consistent function call ABI
2. Kernel resource usage metadata relied on traversing the backend SCC in LLVM-IR. We could make a foreign function call make it just use maximum resources as the trivial fix. A real solution would require the backend to emit function-level metadata and have `lld` do this part. There's already support for stuff like this for PGO that could likely be reused.
3. LDS usage will not be calculated correctly from foreign functions, this would require special relocations as well.

So, currently it "works" if you just so happen to have enough registers, don't use LDS, and expect the ABI not to change in the future.

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


More information about the llvm-commits mailing list