diff options
author | Artem Belevich <tra@google.com> | 2018-03-21 22:22:59 +0000 |
---|---|---|
committer | Artem Belevich <tra@google.com> | 2018-03-21 22:22:59 +0000 |
commit | ecb178bb356fc058a51bbda0d083068b5d83ba2b (patch) | |
tree | 8f1e67971ee6bb3575f461000f388531c7a92a8e /clang/lib/Driver/Driver.cpp | |
parent | 1dce44e8e82c09822e843ccd1df3c6c5de7839f4 (diff) | |
download | bcm5719-llvm-ecb178bb356fc058a51bbda0d083068b5d83ba2b.tar.gz bcm5719-llvm-ecb178bb356fc058a51bbda0d083068b5d83ba2b.zip |
[CUDA] Disable LTO for device-side compilations.
This fixes host-side LTO during CUDA compilation. Before, LTO
pipeline construction was clashing with CUDA pipeline construction.
At the moment there's no point doing LTO on device side as each
device-side TU is a complete program. We will need to figure out
compilation pipeline construction for the device-side LTO when we
have working support for multi-TU device-side CUDA compilation.
Differential Revision: https://reviews.llvm.org/D44691
llvm-svn: 328161
Diffstat (limited to 'clang/lib/Driver/Driver.cpp')
-rw-r--r-- | clang/lib/Driver/Driver.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/clang/lib/Driver/Driver.cpp b/clang/lib/Driver/Driver.cpp index 4712daf0e19..ad65f6f61e5 100644 --- a/clang/lib/Driver/Driver.cpp +++ b/clang/lib/Driver/Driver.cpp @@ -2171,7 +2171,7 @@ class OffloadingActionBuilder final { break; CudaDeviceActions[I] = C.getDriver().ConstructPhaseAction( - C, Args, Ph, CudaDeviceActions[I]); + C, Args, Ph, CudaDeviceActions[I], Action::OFK_Cuda); if (Ph == phases::Assemble) break; @@ -3011,8 +3011,9 @@ void Driver::BuildActions(Compilation &C, DerivedArgList &Args, Args.ClaimAllArgs(options::OPT_cuda_compile_host_device); } -Action *Driver::ConstructPhaseAction(Compilation &C, const ArgList &Args, - phases::ID Phase, Action *Input) const { +Action *Driver::ConstructPhaseAction( + Compilation &C, const ArgList &Args, phases::ID Phase, Action *Input, + Action::OffloadKind TargetDeviceOffloadKind) const { llvm::PrettyStackTraceString CrashInfo("Constructing phase actions"); // Some types skip the assembler phase (e.g., llvm-bc), but we can't @@ -3074,7 +3075,7 @@ Action *Driver::ConstructPhaseAction(Compilation &C, const ArgList &Args, return C.MakeAction<CompileJobAction>(Input, types::TY_LLVM_BC); } case phases::Backend: { - if (isUsingLTO()) { + if (isUsingLTO() && TargetDeviceOffloadKind == Action::OFK_None) { types::ID Output = Args.hasArg(options::OPT_S) ? types::TY_LTO_IR : types::TY_LTO_BC; return C.MakeAction<BackendJobAction>(Input, Output); |