Skip to content

[SYCL][ClangLinkerWrapper] Remove -sycl-device-libraries option#21945

Open
srividya-sundaram wants to merge 3 commits intointel:syclfrom
srividya-sundaram:cleanup-sycl-device-lib
Open

[SYCL][ClangLinkerWrapper] Remove -sycl-device-libraries option#21945
srividya-sundaram wants to merge 3 commits intointel:syclfrom
srividya-sundaram:cleanup-sycl-device-lib

Conversation

@srividya-sundaram
Copy link
Copy Markdown
Contributor

Remove the -sycl-device-libraries option and all related code from clang-linker-wrapper, as it is no longer used by either old or new offload models.

Remove the -sycl-device-libraries option  and all related code from
clang-linker-wrapper, as it is no longer used by either old or new
offload models.
reportError(std::move(Err));
// Gather device library files from --bitcode-library option.
const llvm::Triple Triple(Args.getLastArgValue(OPT_triple_EQ));
SmallVector<std::string, 16> ExtractedDeviceLibFiles;
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Only the unused device library extraction code was removed. The general fat object extraction logic remains in place for processing user input files/libraries.
What was removed was the old device-library-specific extraction path in sycl::linkDevice(), since fat object device libraries (libsycl-*.new.o) no longer exist and device libraries are now passed directly as .bc files via --bitcode-library=

@srividya-sundaram
Copy link
Copy Markdown
Contributor Author

Also updated 7 test files to use --bitcode-library with -cc1 -fsycl-is-device -emit-llvm-bc for device library generation instead of deleting all test cases that referenced -sycl-device-libraries.

Copy link
Copy Markdown
Contributor

@mdtoguchi mdtoguchi left a comment

Choose a reason for hiding this comment

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

Nice cleanup - just some comments on a test.

Comment thread clang/test/Driver/sycl-spirv-default-options.cpp Outdated
Comment thread clang/test/Driver/sycl-spirv-default-options.cpp Outdated
Comment thread clang/test/Driver/sycl-spirv-default-options.cpp Outdated
@srividya-sundaram srividya-sundaram marked this pull request as ready for review May 7, 2026 00:17
@srividya-sundaram srividya-sundaram requested review from a team as code owners May 7, 2026 00:17
def sycl_device_lib_EQ : CommaJoined<["--", "-"], "sycl-device-libraries=">,
Flags<[WrapperOnlyOption]>,
HelpText<"A comma separated list of device libraries that are linked during the device link.">;
def sycl_device_library_location_EQ : Joined<["--", "-"],
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit (not necessarily for this PR) - just wondering why this option is still needed and if it is an opportunity for more clean up.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The -sycl-device-library-location= option is still used/needed by both old and new offload models.
It serves two purposes that are still actively used:
sycl-post-link bfloat16 Device Library Lookup here
Required for NativeCPU target to find utilities library here
Also the driver passes this option to clang-linker-wrapper with the device library directory path.
So we shouldn't be removing this option.

Copy link
Copy Markdown
Contributor

@YuriPlyakhin YuriPlyakhin left a comment

Choose a reason for hiding this comment

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

thank you, very nice clean up.
LGTM - I only reviewed Clang.cpp and clang-linker-wrapper changes. Did not look in details in test changes.

@YuriPlyakhin YuriPlyakhin added the new-offload-model Enables testing with NewOffloadModel. label May 7, 2026
@srividya-sundaram
Copy link
Copy Markdown
Contributor Author

Failed Tests (1): 
SYCL :: USM/fill_any_size.cpp

This SYCL pre commit test failure is unrelated to this patch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

new-offload-model Enables testing with NewOffloadModel.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants