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

Joseph Huber via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 13 09:01:31 PDT 2024


jhuber6 wrote:

> > What's the expected way to target multiple architectures in a single build by the way? The logic I see seems to just take the first value from the LLVM default.
> 
> By default, the cmake file only build the LLVM default. However for HIP we want to also build the target for device. Since normal users may not want that, we need a LLVM variable to enable it.

My current plan is to emit it as part of a GPU toolchain. Right now I do this with the `libc` project so I'm planning on the canonical way of building this to be like this.
```cmake
    -DRUNTIMES_amdgcn-amd-amdhsa_LLVM_ENABLE_RUNTIMES=compiler-rt;libc         \    
    -DLLVM_RUNTIME_TARGETS=default;amdgcn-amd-amdhsa 
```

However, this will require a few tweaks since the runtimes build handles the builtins separately. Going to work on a follow-up for that.

@compnerd is there a canonical way to build for multiple architectures at the same time? I.e. given a standard CMake invocation I'd like to be able to build output for x64, amdgcn, and nvptx64 if they are all supported by the compiler.

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


More information about the llvm-commits mailing list