Skip to content

[SYCL][Driver]Fix ignoring of parallel compilation driver flag when producing SYCLBIN executables - #23570

Merged
kswiecicki merged 3 commits into
intel:syclfrom
lbushi25:fix-syclbin-max-parallel-link-jobs
Oct 22, 2026
Merged

kswiecicki merged 3 commits into
intel:syclfrom
lbushi25:fix-syclbin-max-parallel-link-jobs

Conversation

@lbushi25

@lbushi25 lbushi25 commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

When the flag -fsycl-max-parallel-link-jobs is specified during AOT compilation for a target together with the new offload driver flag, a warning is emitted letting the user know that the flag is unused by the toolchain. This means that the flag is not being passed to the linker wrapper. While not functionally critical, it does impact compilation times. This PR remedies this bug.

@lbushi25
lbushi25 marked this pull request as ready for review October 21, 2026 00:21
@lbushi25
lbushi25 requested review from a team as code owners October 21, 2026 00:21
Comment on lines +2247 to +2249
Expected<StringRef> OutputOrErr = compileDeviceAndBundle(
SplitModules[I].ModuleFilePath, LinkerArgs, Triple,
BackendOptions, AOTDeviceArgs);

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.

Looking further down in usage with compileDeviceAndBundle there are calls that modify the LinkerArgs DerivedArgList via Args.MakeArgString. We need to make this thread safe. The SPIR-V side looks simpler, but the side that can call clang isn't something that can be resolved easily as far as I can see.

@lbushi25 lbushi25 Oct 21, 2026 •

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.

Yeah, I decided to narrow the scope of this PR and only do the parallelization when the target is SPIR-V. In this aforementioned case, The Args.MakeArgStrings was only being used in a couple of places to prepare the translator arguments so I replaced its uses with string literals and static constexpr arrays which are thread-safe. Have a look at the latest changes please!

@mdtoguchi mdtoguchi left a comment

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.

Thanks for the updates - LGTM

@lbushi25

Copy link
Copy Markdown
Contributor Author

@intel/llvm-gatekeepers Consider merging this please!

@kswiecicki
kswiecicki merged commit c00d41f into intel:sycl Oct 22, 2026
30 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants