-
Couldn't load subscription status.
- Fork 792
[libspirv][remangler] Don't remangle internal functions. #20148
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
steffenlarsen
merged 1 commit into
intel:sycl
from
Maetveis:libclc_remangler_skip_internal_functions
Sep 22, 2025
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IIUC remangling is handling function parameter type and address space, but is unrelated to function linkage type.
I think the remangling process could be refined to skip functions like __clc_copysign whose parameter types don't need remangling.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't the purpose of remangling that code compiled in SYCL (C++) language mode be able to call into libspirv functions which are compiled as OpenCL C, as there are differences between OpenCL and C++ with regards to e.g.
long longsize and char signedness?If there's a function in libspirv that is internal linkage user code (the code we're linking libspirv into at user code compile time) shouldn't be calling it by definition. If it isn't being called by user code there can be no issues with C++ code looking for a different mangled name than what libspirv would provide.
The same problem could occur with functions that have types that need renaming.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right. It seems you're correct.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe @Maetveis is right. The point of remangling is to give C++ code the opportunity to link against the OpenCL-C-based libclc, without there being signedness/size issues. Since functions with internal linkage shouldn't interface with C++ it should be fine to skip them during remangling.