Repository navigation
[SYCL] Avoid runtime registration for empty device pre-link outputs - #23545
vishalshetagar wants to merge 5 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
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
|
@vishalshetagar Looks like the PR needs to be merged with HEAD since there are merge conflicts, could you take a look? Thanks |
…mpty-images # Conflicts: # clang/test/OffloadTools/clang-linker-wrapper/linker-wrapper-sycl.cpp # clang/tools/clang-linker-wrapper/ClangLinkerWrapper.cpp
…mpty-images # Conflicts: # clang/test/Driver/sycl-nordc-wrapper-object.cpp # clang/tools/clang-linker-wrapper/ClangLinkerWrapper.cpp
Keep the SYCL image group when post-link removes every image. Emit a container with one empty image only when the combined group is empty, so the host compilation still has its required input and omits runtime registration. Mixed target groups retain only their nonempty images. Extend the existing image test for empty tool/library post-link paths, ELF and COFF host wrapping, and mixed targets. Give the no-RDC section fixture a real kernel because its checks require a nonempty image. Validated with 139 focused lit tests, Linux host linking for both drivers, 12 ELF/COFF wrapper checks, and native Windows linking/execution of eight executables and eight DLLs plus two nonempty failure controls. Assisted-by: Codex
|
Thanks @sarnex I’ve merged the latest upstream sycl branch and resolved the conflicts. Retesting caught an empty-image issue with the updated non-RDC flow, which I fixed in the follow-up commit. All 139 focused regression tests passed, along with Linux and native Windows linking checks. The changes are pushed and the PR description is updated. |
-fsycl-linkemits 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 for empty inputs, mixed targets, ELF/COFF wrapping, and host linking without the SYCL runtime. Fixtures whose section, registration, or missing-
oclocchecks require a nonempty image use real kernels with integration-header inclusion disabled.Validation after merging upstream
55a172cc383c:llvm/test/tools/sycl-post-linksuite. Clang and the affected tools were rebuilt in WSL with assertions enabled; auxiliary tools and device libraries came from the matching upstream CI toolchain.-nolibsycl.Windows objects were generated by the rebuilt tools in WSL; linking and execution were native Windows. The compiler tools were not built natively on Windows.
The previously observed GPU E2E failures remain outside this fix:
bindless_images/vulkan_interop/external_semaphore_regular_cl.cppalso failed 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.