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

Jon Chesterfield via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 17 12:15:13 PDT 2024


JonChesterfield wrote:

There are three things here.

One is the very complicated logic in compiler-rt cmake for deciding what to build.

Two is the long-standing machine code linking puzzle for amdgpu.

Three is that amdgpu really could do with a compiler-rt builtins to factor parts of the compiler backend / intrinsics into.

We can postpone 2 by noting that builtins.a is an archive and archives can have object or bitcode in. 1 is just really careful programming.

I'd like there to be a target-builtins for the two amdgpu and nvptx targets, provided it serves a similar role to on the other targets, and doesn't import a load of gpu-offload-centric design decisions like unexpectedly wrapping everything in x64 elf files or deciding archive files don't mean what they do everywhere else.

At the lowest level, a gpu triple is just a bare metal embedded target. Compiler-rt builtins is the lowest level, it can and should use that model.

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


More information about the llvm-commits mailing list