llvm-project/clang/lib/Driver/ToolChains
Yaxun Liu 9767089d00 [HIP] Support early finalization of device code for -fno-gpu-rdc
This patch renames -f{no-}cuda-rdc to -f{no-}gpu-rdc and keeps the original
options as aliases. When -fgpu-rdc is off,
clang will assume the device code in each translation unit does not call
external functions except those in the device library, therefore it is possible
to compile the device code in each translation unit to self-contained kernels
and embed them in the host object, so that the host object behaves like
usual host object which can be linked by lld.

The benefits of this feature is: 1. allow users to create static libraries which
can be linked by host linker; 2. amortized device code linking time.

This patch modifies HIP action builder to insert actions for linking device
code and generating HIP fatbin, and pass HIP fatbin to host backend action.
It extracts code for constructing command for generating HIP fatbin as
a function so that it can be reused by early finalization. It also modifies
codegen of HIP host constructor functions to embed the device fatbin
when it is available.

Differential Revision: https://reviews.llvm.org/D52377

llvm-svn: 343611
2018-10-02 17:48:54 +00:00
..
Arch [AArch64] Support adding X[8-15,18] registers as CSRs. 2018-09-25 16:48:40 +00:00
AMDGPU.cpp AMDGPU: Default to hidden visibility 2018-08-30 08:18:06 +00:00
AMDGPU.h AMDGPU: Default to hidden visibility 2018-08-30 08:18:06 +00:00
AVR.cpp
AVR.h
Ananas.cpp Remove unused includes of clang/Config/config.h 2018-04-28 23:48:36 +00:00
Ananas.h Add support for Ananas platform 2017-06-25 08:29:09 +00:00
BareMetal.cpp [VFS] vfs::directory_iterator yields path and file type instead of full Status 2018-09-14 12:47:38 +00:00
BareMetal.h [Driver] Allow drivers to add multiple libc++ include paths 2018-04-10 19:55:55 +00:00
Clang.cpp [HIP] Support early finalization of device code for -fno-gpu-rdc 2018-10-02 17:48:54 +00:00
Clang.h Remove \brief commands from doxygen comments. 2018-05-09 01:00:01 +00:00
CloudABI.cpp Remove unused includes of clang/Config/config.h 2018-04-28 23:48:36 +00:00
CloudABI.h [Driver] Allow drivers to add multiple libc++ include paths 2018-04-10 19:55:55 +00:00
CommonArgs.cpp [HIP] Support early finalization of device code for -fno-gpu-rdc 2018-10-02 17:48:54 +00:00
CommonArgs.h [HIP] Support offloading by linker script 2018-05-18 15:07:56 +00:00
Contiki.cpp
Contiki.h [Driver] Allow drivers to add multiple libc++ include paths 2018-04-10 19:55:55 +00:00
CrossWindows.cpp [MinGW, CrossWindows] Allow passing -static together with -shared 2018-02-27 19:42:19 +00:00
CrossWindows.h [Driver][Darwin] Pass -munwind-table when !UseSjLjExceptions. 2017-08-03 23:55:42 +00:00
Cuda.cpp [HIP] Support early finalization of device code for -fno-gpu-rdc 2018-10-02 17:48:54 +00:00
Cuda.h [DEBUGINFO] Disable unsupported debug info options for NVPTX target. 2018-07-27 19:45:14 +00:00
Darwin.cpp [ubsan] Enable -fsanitize=vptr on Apple devices and simulators 2018-08-28 18:01:42 +00:00
Darwin.h [Xray] Darwin - Enable in the driver side 2018-08-27 05:16:09 +00:00
DragonFly.cpp Introduce -nostdlib++ flag to disable linking the C++ standard library. 2017-07-25 18:02:57 +00:00
DragonFly.h
FreeBSD.cpp Fix a typo/regression in r335495. 2018-07-10 17:44:08 +00:00
FreeBSD.h Toolchain: Normalize dwarf, sjlj and seh eh 2017-11-29 07:25:12 +00:00
Fuchsia.cpp [profile] Support profiling runtime on Fuchsia 2018-07-25 03:01:35 +00:00
Fuchsia.h [Driver] Enable SafeStack by default on Fuchsia 2018-03-07 02:49:58 +00:00
Gnu.cpp [VFS] vfs::directory_iterator yields path and file type instead of full Status 2018-09-14 12:47:38 +00:00
Gnu.h Remove \brief commands from doxygen comments. 2018-05-09 01:00:01 +00:00
HIP.cpp [HIP] Support early finalization of device code for -fno-gpu-rdc 2018-10-02 17:48:54 +00:00
HIP.h [HIP] Support early finalization of device code for -fno-gpu-rdc 2018-10-02 17:48:54 +00:00
Haiku.cpp [Driver] Allow drivers to add multiple libc++ include paths 2018-04-10 19:55:55 +00:00
Haiku.h [Driver] Allow drivers to add multiple libc++ include paths 2018-04-10 19:55:55 +00:00
Hexagon.cpp [Hexagon] Remove fp-contract=fast setting for at O3 2018-09-12 20:35:56 +00:00
Hexagon.h [Hexagon] Emit a warning when -fvectorize is given without -mhvx 2018-04-16 19:11:17 +00:00
Lanai.h [Driver] Allow drivers to add multiple libc++ include paths 2018-04-10 19:55:55 +00:00
Linux.cpp [Driver] Fix missing MultiArch include dir on powerpcspe 2018-09-14 12:42:13 +00:00
Linux.h [Android] Default to -fno-math-errno 2018-08-22 17:43:05 +00:00
MSVC.cpp [clang-cl] Provide separate flags for all the /O variants 2018-09-25 14:10:26 +00:00
MSVC.h clang-cl: Postpone Wmsvc-not-found emission until link.exe gets used. 2018-07-17 15:07:40 +00:00
MSVCSetupApi.h Update clang-cl driver for MSVC 2017. 2017-03-15 16:07:35 +00:00
MinGW.cpp [MinGW] Allow using ASan 2018-10-01 20:53:25 +00:00
MinGW.h [MinGW] Allow using ASan 2018-10-01 20:53:25 +00:00
Minix.cpp Introduce -nostdlib++ flag to disable linking the C++ standard library. 2017-07-25 18:02:57 +00:00
Minix.h
MipsLinux.cpp Remove unused includes of clang/Config/config.h 2018-04-28 23:48:36 +00:00
MipsLinux.h [Driver] Change MipsLinux default linker from "lld" to "ld.lld" 2018-08-26 19:47:23 +00:00
Myriad.cpp [Driver] Allow drivers to add multiple libc++ include paths 2018-04-10 19:55:55 +00:00
Myriad.h [Driver] Allow drivers to add multiple libc++ include paths 2018-04-10 19:55:55 +00:00
NaCl.cpp Revert "Handle the default case" 2018-04-10 21:29:18 +00:00
NaCl.h [Driver] Allow drivers to add multiple libc++ include paths 2018-04-10 19:55:55 +00:00
NetBSD.cpp Support linking static PIE binaries on NetBSD 2018-07-12 21:21:29 +00:00
NetBSD.h [Driver] Allow drivers to add multiple libc++ include paths 2018-04-10 19:55:55 +00:00
OpenBSD.cpp OpenBSD driver needs ld.lld in sanitizer context 2018-06-28 13:49:41 +00:00
OpenBSD.h OpenBSD add C++ runtime in a driver's standpoint 2018-04-19 06:55:30 +00:00
PS4CPU.cpp [Driver] Add flag "--dependent-lib=..." when enabling asan or ubsan on PS4. 2018-06-06 14:04:15 +00:00
PS4CPU.h [Driver] Add flag "--dependent-lib=..." when enabling asan or ubsan on PS4. 2018-06-06 14:04:15 +00:00
RISCVToolchain.cpp NFC: Fix some darwin linker warnings introduced in r338385 2018-09-27 20:36:28 +00:00
RISCVToolchain.h NFC: Fix some darwin linker warnings introduced in r338385 2018-09-27 20:36:28 +00:00
Solaris.cpp [Solaris] Silence -pthread warning on Solaris 2018-02-06 13:21:12 +00:00
Solaris.h [Sanitizers] Basic Solaris sanitizer support (PR 33274) 2018-02-05 23:59:13 +00:00
TCE.cpp Driver/ToolChains: Remove extra semicolons. NFC 2017-03-09 00:14:57 +00:00
TCE.h
WebAssembly.cpp [WebAssembly] clang-format (NFC) 2018-08-31 20:57:00 +00:00
WebAssembly.h [WebAssembly] clang-format (NFC) 2018-08-31 20:57:00 +00:00
XCore.cpp [OpenMP] Extend CLANG target options with device offloading kind. 2017-07-06 16:22:21 +00:00
XCore.h [OpenMP] Extend CLANG target options with device offloading kind. 2017-07-06 16:22:21 +00:00