[SYCL] [ClangSYCLLinker] Add full sycl-post-link functionality to clang-sycl-linker#21977
[SYCL] [ClangSYCLLinker] Add full sycl-post-link functionality to clang-sycl-linker#21977srividya-sundaram wants to merge 5 commits into
Conversation
…getBackend in sycl-post-link settings
|
@YuriPlyakhin @maksimsab Could you please take a look at this first-pass patch for adding sycl-post-link support/infrastructure in clang-sycl-linker tool. Thanks! |
| // and inter-image symbol export. Without setting it here, ESIMD processing | ||
| // silently ignores the flag and always behaves as if device-image | ||
| // dependencies are disallowed. | ||
| Settings.ESIMDOptions.AllowDeviceImageDependencies = |
There was a problem hiding this comment.
This seemed like a bug. Please weigh in.
For context:
--sycl-allow-device-image-dependencies was correctly preventing EmitOnlyKernelsAsEntryPoints from being set, but ESIMDOptions.AllowDeviceImageDependencies was never set.
This meant ESIMD processing (module cleanup, dependency graph construction, symbol export decisions) always behaved as if device image dependencies were disallowed, even when the user passed --sycl-allow-device-image-dependencies. The wrong behavior would be silent, no error, just subtly incorrect ESIMD output.
The fix was:
Add Settings.ESIMDOptions.AllowDeviceImageDependencies = Args.hasArg(OPT_sycl_allow_device_image_dependencies) in both clang-sycl-linker and clang-linker-wrapper. The pre-existing TODO comment in clang-linker-wrapper was tracking this missing piece
@srividya-sundaram , would it be possible to align this patch design to what we are doing in community as much as possible? |
|
|
||
| /// Run sycl-post-link tool for SYCL offloading. | ||
| static Expected<std::vector<SplitModule>> | ||
| runSYCLPostLinkTool(ArrayRef<StringRef> InputFiles, const ArgList &Args, |
There was a problem hiding this comment.
Do we need to bring SYCLPostLinkTool to clang-sycl-linker at all?
I thought the idea was to get rid of sycl-post-link-tool in new offloading model and use library instead, if necessary.
This is patch number
2in the SYCL Device Pipeline migration fromclang-linker-wrappertoclang-sycl-linkerPatch number
1can be found here.This PR adds full sycl-post-link functionality to
clang-sycl-linkerwith 100% feature parity toclang-linker-wrapper, advancing the new SYCL offload model migration.Changes:
getSYCLPostLinkSettings(), getTripleBasedSYCLPostLinkOpts(), runSYCLPostLinkTool(), and runSYCLPostLinkLibrary()Note: sycl-post-link logic remains in clang-linker-wrapper for now during the offload model migration.