Repository navigation
[SYCL] Avoid runtime registration for empty device pre-link outputs - #23545
Open
vishalshetagar wants to merge 2 commits into
Open
vishalshetagar wants to merge 2 commits into
vishalshetagar wants to merge 2 commits into
Conversation
When -fsycl-link has no device images or only empty images, emit the required output object without references to __sycl_register_lib or __sycl_unregister_lib. This allows a host linker to link host-only and kernel-free configurations without the SYCL runtime. Handle empty images in both offload wrappers, omit empty modules from post-link image tables, and generate an empty object when the new driver has no device-link outputs. Preserve registration for nonempty images and NativeCPU placeholders. Extend existing regression tests for empty and mixed images, host-only inputs, and empty modules through both post-link implementations. Fixes intel#23528 Assisted-by: OpenAI Codex
Contributor
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
Give the non-RDC wrapper and linker-wrapper command tests a kernel so post-link processing retains an image. Empty sources now correctly omit images and registration, so they cannot exercise image sections or the missing-ocloc diagnostic. Disable integration-header inclusion to keep these standalone fixtures independent of installed SYCL headers and host C++ libraries. Extend the non-RDC test to check that empty ELF and COFF objects contain no embedded device image or SYCL registration references. Reproduced both original failures with the PR's CI-built compiler. The updated tests pass, along with the surrounding SYCL driver, wrapper, and post-link tests: 294 passed, 3 expected failures, 15 unsupported, and no unexpected failures. Assisted-by: OpenAI Codex
This branch has not been deployed
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.
-fsycl-linkcurrently emits SYCL runtime registration references even when there are no device images to register. This prevents host-only and kernel-free configurations from linking with a host linker unless they also link the SYCL runtime.This change makes both the old and new offload driver paths produce the required output object without references to
__sycl_register_libor__sycl_unregister_libwhen there are no device images or all images are empty.Extend existing regression tests to cover these cases and host linking without the SYCL runtime.
Validation:
llvm/test/tools/sycl-post-linksuite, using rebuilt affected tools with assertions enabled and a prebuilt DPC++ frontend.The non-RDC wrapper and linker-wrapper command tests now use real kernels where they require a nonempty image. This preserves their section, registration, and missing-
oclocchecks after empty images are omitted. Integration-header inclusion is disabled in these standalone fixtures, and the non-RDC test additionally checks empty ELF and COFF objects.Follow-up validation with the PR's CI-built Clang 24 toolchain: both original compiler-test failures were reproduced, then passed after the fixture changes. The wider SYCL driver, linker-wrapper, and complete post-link selection finished with 294 passed, 3 expected failures, 15 unsupported, and no unexpected failures. An empty non-RDC COFF object also passed native Microsoft executable linking/execution and DLL linking/loading/calling with automatic SYCL library linkage disabled (
-nolibsycl).The GPU E2E failures are separate from these compiler-test fixes:
bindless_images/vulkan_interop/external_semaphore_regular_cl.cppreports "The external semaphore wait did not submit the preceding batch." The same failure is present in the base commit's CI job, before this PR's changes.WorkGroupMemory/basic_usage.cppswap failure matches the existing reports in SYCL :: WorkGroupMemory/basic_usage.cpp has unrelated failures on Intel Arc With Level 0 Windows #22293 and [SYCL][E2E] Failures in unrelated tests on Intel Arc GPUs (Level Zero) with parallel E2E runs on Linux (B580) and Windows (A770) #23521.These hardware-dependent failures were not changed or validated locally on Intel GPU hardware.
Fixes #23528.