-
Notifications
You must be signed in to change notification settings - Fork 752
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pass -foffload-lto instead of -flto for cuda/hip kernels in clangLinkerWrapper #16605
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1533,12 +1533,17 @@ 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"); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should this go upstream? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. +1 on adding this change to upstream code. I am also wondering why it is not an issue in the upstream compiler and why we see it only with SYCL offloading. Also @omarahmed1111 can you please comment on the test failure? Thanks There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The test failure for |
||
} else { | ||
CmdArgs.push_back("-flto"); | ||
} | ||
|
||
if (!Triple.isNVPTX() && !Triple.isSPIRV()) | ||
CmdArgs.push_back("-Wl,--no-undefined"); | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is there an upstream pr for this based on previous feedback?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought we are going to do this after merging this. I will open one for that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok as long as you'll make an upstream PR lgtm to merge here first