[Clang] Initial support for linking offloading code in tool
authorJoseph Huber <jhuber6@vols.utk.edu>
Tue, 4 Jan 2022 22:20:04 +0000 (17:20 -0500)
committerJoseph Huber <jhuber6@vols.utk.edu>
Tue, 1 Feb 2022 04:11:41 +0000 (23:11 -0500)
commitd0744585f9ea842ca97855b2e002fddc893c4a92
tree0ed84c77e3acfc9664ff274f6661bb3f0705865d
parentb8239af0eeedfa67d9fac28d20685b7a09e2935a
[Clang] Initial support for linking offloading code in tool

This patch adds the initial support for linking NVPTX offloading code
using the clang-linker-wrapper tool. This uses the extracted device
files and runs `nvlink` on them. Currently this is then passed to the
existing toolchain for creating linkable OpenMP offloading programs
using `clang-offload-wrapper` and compiling it manually using `llc`.
More work is required to support LTO, Bitcode linking, AMDGPU, and x86
offloading.

Depends on D116545

Differential Revision: https://reviews.llvm.org/D116627
clang/tools/clang-linker-wrapper/ClangLinkerWrapper.cpp