Summary:
A previous patch ensured that we can't use `-foffload-lto` with CUDA in
non-RDC mode. This did not correctly check for if we were actually
offloading to CUDA so it ended up preventing us from using LTO for
OpenMP.
options::OPT_foffload_lto_EQ)
->getAsString(Args)
<< Triple.getTriple();
- } else if (Triple.isNVPTX() && !IsRDCMode) {
+ } else if (Triple.isNVPTX() && !IsRDCMode &&
+ JA.isDeviceOffloading(Action::OFK_Cuda)) {
D.Diag(diag::err_drv_unsupported_opt_for_language_mode)
<< Args.getLastArg(options::OPT_foffload_lto,
options::OPT_foffload_lto_EQ)