[Clang] Parse toolchain-specific offloading arguments directly
OpenMP supports multiple offloading toolchains and architectures. In order to support this we originally used `getArgsForToolchain` to get the arguments only intended for each toolchain. This allowed users to manually specify if an `--offload-arch=` argument was intended for which toolchain using `-Xopenmp-target=` or other methods. For example, ``` clang input.c -fopenmp -fopenmp-targets=nvptx64,amdgcn -Xopenmp-target=nvptx64 --offload-arch=sm_70 -Xopenmp-target=amdgcn --offload-arch=gfx908 ``` However, this was causing problems with the AMDGPU toolchain. This is because the AMDGPU toolchain for OpenMP uses an `amdgpu` arch to determine the architecture. If this tool is not availible the compiler will exit with an error even when manually specifying the architecture. This patch pulls out the logic in `getArgsForToolchain` and specializes it for extracting `--offload-arch` arguments to avoid this. Reviewed By: JonChesterfield, yaxunl Differential Revision: https://reviews.llvm.org/D129435
parent
74c9030a
Please register or sign in to comment