[SYCL] reapproaching guard duty#22655
Open
cperkinsintel wants to merge 2 commits into
Open
Conversation
cperkinsintel
requested review from
KseniyaTikhomirova and
Copilot
and removed request for
KseniyaTikhomirova
July 16, 2026 20:38
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-setup-steps.yml file specifying one with the runs-on attribute. See the docs for more details.
Adjusts the MSVC STL global-variable handling for SYCL device code so diagnostics are suppressed at the point they’re emitted (Sema use-sites), and removes the fragile system_header/sycl_global_var workaround that breaks under -E preprocess round-trips.
Changes:
- Removes
#pragma clang system_headerandsycl_global_varusage from the MSVC bit utils wrapper. - Adds a Sema allowlist to permit reads of specific MSVC STL runtime globals (e.g.
std::__isa_available) from device code. - Adds a regression test covering
-Epreprocess →.ii→ recompile round-trip.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| sycl/test/regression/msvc_bit_utils_wrapper_preprocess_roundtrip.cpp | Adds a preprocess round-trip regression test for the wrapper/header scenario. |
| sycl/include/sycl/stl_wrappers/__msvc_bit_utils.hpp | Removes the system-header + attribute workaround and relies on Sema allowlisting. |
| clang/lib/Sema/SemaExpr.cpp | Introduces std::__isa_available read allowlisting for Windows MSVC environments. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Our fix for VS2026 was being guarded by
sycl_global_varso as to not trigger "non const global in device code" warnings. But that doesn't work when preprocessing (-Eflag), so now we are adjusting the guard to be closer to where the diagnostic is actually generated. This is is more straightforward, less magical, and exactly the same mechanism that is already used (isMsvcMathFn).