Skip to content

[Clang][SYCL] Fix bundler target triple for SPIR-V in old offload model#22429

Merged
wenju-he merged 4 commits into
intel:sycl-webfrom
wenju-he:fix-sycl-offload-old-model.cpp
Jun 25, 2026
Merged

[Clang][SYCL] Fix bundler target triple for SPIR-V in old offload model#22429
wenju-he merged 4 commits into
intel:sycl-webfrom
wenju-he:fix-sycl-offload-old-model.cpp

Conversation

@wenju-he

@wenju-he wenju-he commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Upstream f8cb6be ("clang: Use the effective triple string for offload jobs") added FOUR_IDENT normalization in OffloadBundler::ConstructJob, causing SYCL SPIR-V device triples to be emitted in 4-component form (spir64-unknown-unknown-unknown) instead of the 3-component form (spir64-unknown-unknown) expected by the old offload model bundler.

Skip FOUR_IDENT normalization for SYCL+SPIR/SPIRV targets in bundling jobs to preserve the 3-component triple format.

Fixes

  • Driver/clang-offload-bundler-bc-archive-support-linux-old-model.cpp
  • Driver/sycl-no-rdc-fat-archive-old-model.cpp
  • Driver/sycl-offload-old-model.cpp
  • Driver/sycl-oneapi-gpu-intelgpu.cpp
  • Driver/sycl-oneapi-gpu-nvidia.cpp

Changing to 4-component triples could be done later together with

// TODO: All targets should use the 4-field triple, which can be done

Upstream f8cb6be ("clang: Use the effective triple string for offload
jobs") added FOUR_IDENT normalization in OffloadBundler::ConstructJob,
causing SYCL SPIR-V device triples to be emitted in 4-component form
(spir64-unknown-unknown-unknown) instead of the 3-component form
(spir64-unknown-unknown) expected by the old offload model bundler.

Skip FOUR_IDENT normalization for SYCL+SPIR/SPIRV targets in bundling
jobs to preserve the 3-component triple format.

Fixes
-  Driver/clang-offload-bundler-bc-archive-support-linux-old-model.cpp
-  Driver/sycl-no-rdc-fat-archive-old-model.cpp
-  Driver/sycl-offload-old-model.cpp
-  Driver/sycl-oneapi-gpu-intelgpu.cpp

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@wenju-he wenju-he requested a review from a team as a code owner June 25, 2026 00:41
wenju-he and others added 3 commits June 25, 2026 03:20
Extend the FOUR_IDENT normalization skip (added in ffb3b45) to also
cover SYCL NVPTX targets. Upstream f8cb6be caused bundling to emit
nvptx64-nvidia-cuda-unknown (4-component) while unbundling still uses
nvptx64-nvidia-cuda (3-component), breaking fat object round-trips.

Fixes Driver/sycl-oneapi-gpu-nvidia.cpp NVIDIA_FATO/NVIDIA_CONSUME_FAT.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@wenju-he

Copy link
Copy Markdown
Contributor Author

Filed issue #22443 as a follow-up to switch to 4-component triple.

@wenju-he wenju-he merged commit 053e155 into intel:sycl-web Jun 25, 2026
@wenju-he wenju-he deleted the fix-sycl-offload-old-model.cpp branch June 25, 2026 23:12
wenju-he added a commit that referenced this pull request Jun 26, 2026
…el (#22429)

Upstream f8cb6be ("clang: Use the effective triple string for
offload jobs") added FOUR_IDENT normalization in
OffloadBundler::ConstructJob, causing SYCL SPIR-V device triples to be
emitted in 4-component form (spir64-unknown-unknown-unknown) instead of
the 3-component form (spir64-unknown-unknown) expected by the old
offload model bundler.

Skip FOUR_IDENT normalization for SYCL+SPIR/SPIRV targets in bundling
jobs to preserve the 3-component triple format.

Fixes
- Driver/clang-offload-bundler-bc-archive-support-linux-old-model.cpp
- Driver/sycl-no-rdc-fat-archive-old-model.cpp
- Driver/sycl-offload-old-model.cpp
- Driver/sycl-oneapi-gpu-intelgpu.cpp
- Driver/sycl-oneapi-gpu-nvidia.cpp

Changing to 4-component triples could be done later together with
https://github.com/intel/llvm/blob/5bec703f62da/clang/lib/Driver/ToolChains/Clang.cpp#L10369

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
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.

1 participant