[OpenMP][JIT] Introduce support for AMDGPU
authorJohannes Doerfert <johannes@jdoerfert.de>
Wed, 28 Dec 2022 06:31:28 +0000 (22:31 -0800)
committerJohannes Doerfert <johannes@jdoerfert.de>
Wed, 4 Jan 2023 18:14:27 +0000 (10:14 -0800)
commitc63dced93b46ec3ab925d9049f2a8c8901f5d913
tree42016cf627fa4b31d501c0d4960157ba67b55d00
parentc43a7874a3012ae0c6aa983a882a0b23284c2ec7
[OpenMP][JIT] Introduce support for AMDGPU

To JIT kernels for AMDGPUs we need to provide the architecture, the
triple, and a post-link callback. The first two are simple, the last one
is a little more complicated since we need to invoke `lld`. There is
some library interface but for that we need the lld library, which is
not generally available, thus we go with the executable for now. In
either way we need to manifest the (amdgcn) object file and read the
output from another file. We should try to avoid that in the future.
The options for `lld` are copied from the way clang invokes it.

Reviewed By: tianshilei1992

Differential Revision: https://reviews.llvm.org/D140720
openmp/libomptarget/plugins-nextgen/amdgpu/src/rtl.cpp