================
@@ -498,12 +498,16 @@ Expected<StringRef> clang(ArrayRef<StringRef> InputFiles,
const ArgList &Args) {
};
// Forward all of the `--offload-opt` and similar options to the device.
- CmdArgs.push_back("-flto");
for (auto &Arg : Args.filtered(OPT_offload_opt_eq_minus, OPT_mllvm))
CmdArgs.append(
{"-Xlinker",
Args.MakeArgString("--plugin-opt=" + StringRef(Arg->getValue()))});
+ if (Triple.isNVPTX() || Triple.isAMDGPU())
+ CmdArgs.push_back("-foffload-lto");
+ else
+ CmdArgs.push_back("-flto");
----------------
jhuber6 wrote:
Do you have a reproducer or an example of what the error is? You can pass
`flto` to `--target=nvptx64-nvidia-cuda` correctly. The only reason this would
fail is if it's somehow using an older version of clang as far as I'm aware.
https://github.com/llvm/llvm-project/pull/125243
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits