Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions clang/lib/Driver/ToolChains/Clang.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5993,6 +5993,8 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
options::OPT_no_offload_new_driver, false);
Arg *SYCLSplitMode =
Args.getLastArg(options::OPT_fsycl_device_code_split_EQ);
Arg *OffloadLTO = Args.getLastArg(options::OPT_foffload_lto,
options::OPT_foffload_lto_EQ);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like something that would benefit the community as it isn't specific to SYCL. Would this be better to just upstream instead of doing intel/llvm?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are to SYCL specific checks here before some of these diagnostics are emitted (like SYCLSplitMode). Unless I am mis-understanding what you are referring to.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, there are SYCL specific things here, but the fix itself can be applied to upstream and be pulled into intel/llvm as it also impacts OpenMP upstream behaviors.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but the fix itself can be applied to upstream and be pulled into intel/llvm as it also impacts OpenMP upstream behaviors.

err_drv_sycl_thinlto_split_off is specific to intel/llvm only and is therefore handled here, while the other two diagnostics are addressed in the upstream patch.

bool IsDeviceCodeSplitDisabled =
SYCLSplitMode && StringRef(SYCLSplitMode->getValue()) == "off";
bool IsSYCLLTOSupported =
Expand All @@ -6014,12 +6016,11 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
->getAsString(Args)
<< "-fno-gpu-rdc";
} else if (JA.isDeviceOffloading(Action::OFK_SYCL) &&
IsDeviceCodeSplitDisabled && LTOMode == LTOK_Thin) {
IsDeviceCodeSplitDisabled && LTOMode == LTOK_Thin &&
OffloadLTO) {
D.Diag(diag::err_drv_sycl_thinlto_split_off)
<< SYCLSplitMode->getAsString(Args)
<< Args.getLastArg(options::OPT_foffload_lto,
options::OPT_foffload_lto_EQ)
->getAsString(Args);
<< OffloadLTO->getAsString(Args);
} else {
assert(LTOMode == LTOK_Full || LTOMode == LTOK_Thin);
CmdArgs.push_back(Args.MakeArgString(
Expand Down
Loading