Conversation
parseSplitModulesFromFile required the 3-column "[Code|Properties|Symbols]" table unconditionally, but clang-linker-wrapper omits -symbols when -sycl-thin-lto is set, so sycl-post-link emits a 2-column "[Code|Properties]" table instead. This made the parser reject the table with "invalid SYCL Table file.", aborting the link for -foffload-lto=thin. Accept both header/row shapes, leaving Symbols empty when the column is absent. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@wenju-he, do you have a design doc for enabling ThinLTO in SYCL mode? |
I have attached a diagram of current implementation (almost finished and I'm splitting it into smaller patches for review) in jira CMPLRLLVM-78079.
I agree with you. See #14259 for background that adds per-TU sycl-post-link for ThinLTO. |
Not temporary, but can be reverted when sycl-post-link is deprecated, which is out of scope of current ThinLTO implementation. |
mdtoguchi
left a comment
There was a problem hiding this comment.
Looks OK to me. As an aside, looked through the existing LIT tests and could not find anything that is verifying the -sycl-thin-lto behavior for clang-linker-wrapper in that it restricts the Symbols column for the sycl-post-link call.
|
@intel/llvm-gatekeepers please consider merging |
I don't think we can deprecate The trickiest part to integrate into LTO pipeline is module splitting functionality. AFAIK, AMDGPU pipeline has implemented similar splitting in the CodeGen, but heuristic they use is different. We can probably integrate split functionality into SPIR-V backend to get Deprecating |
I agree, But I think we can implement this incrementally. |
Probably. I think @sarnex landed this patch before AMD folks pushed splitting capabilities the upstream branch. |
|
It looks like the final AMDGPU splitting support was merged in May 2024 where as my change was merged in June 2024, although some infra work for the AMDGPU splitting support was merged earlier in April 2024. I don't think I knew about the AMDGPU splitting support at the time, at the time we had a looser relationship with upstream than we do today. I never merged full working SYCL thinLTO support, I had a prototype under-review here, but eventually I decided to delay working on it because the new offload model device linking flow for SYCL support in intel/llvm was so different from upstream at the time and a lot of changes were required, I didn't see it as a good use of resources to get it working when it would all have to be all redone when we unify the device linking flow with upstream. I think we are much closer now.
I agree with this, we shouldn't need to call the Note that at least when I was working on it, the specialization constants feature required running a special pass on fully linked module, if the module was not fully linked, the feature would not work correctly. I'm not sure if this is still true, maybe the feature changed. But this is an important case to consider, some language features may require processing a fully linked module.
Right, we should use the new community mechanism for splitting, we should not rely on |
|
Thanks @sarnex for the suggestions. We can do migration from the current per-TU sycl-post-link split (used to produce ThinLTO's per-Task inputs) to upstream splitModuleTransitiveFromEntryPoints as a follow-up step for ThinLTO. It might not be trivial work since sycl-post-link does more than splitModuleTransitiveFromEntryPoints, doing it separately also allow us to monitor regressions. |
|
@intel/llvm-gatekeepers please merge, thanks |
parseSplitModulesFromFile required the 3-column
"[Code|Properties|Symbols]" table unconditionally, but clang-linker-wrapper omits -symbols when -sycl-thin-lto is set, so sycl-post-link emits a 2-column "[Code|Properties]" table instead. This made the parser reject the table with "invalid SYCL Table file.", aborting the link for -foffload-lto=thin. Accept both header/row shapes, leaving Symbols empty when the column is absent.