-
Notifications
You must be signed in to change notification settings - Fork 795
[SYCL] Move Subgroup*INTEL SPIR-V built-in declarations to clang SPIRVBuiltins.td #17732
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
[SYCL] Move Subgroup*INTEL SPIR-V built-in declarations to clang SPIRVBuiltins.td #17732
Conversation
…VBuiltins.td Motivation is similar to c040f9a : unify with SPV-IR mangling. SubgroupBlockReadINTEL is not handled in this PR. SPV-IR appends return type to mangled function name. It might be simpler for SYCL header to keep current mangling.
frasercrmck
left a comment
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.
libspirv LGTM, thank you.
To be honest I'm not sure why some of this amdgcn-amdhsa stuff is target-specific if they're just using generic SPIR-V builtins. I'd have thought other targets may want to make use of them.
I'm also not sure if/why we need to "declare" the SPIR-V builtins in places if they're going to be coming from clang anyway.
Those two are questions for another PR but worth looking into.
| __CLC_DECLARE_SHUFFLES(unsigned long, m); | ||
| __CLC_DECLARE_SHUFFLES(double, d); | ||
| #define __CLC_DECLARE_SHUFFLES(TYPE) \ | ||
| _CLC_OVERLOAD _CLC_DECL TYPE __spirv_SubgroupShuffleINTEL( \ |
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'm not sure if we can remove implementation of existing built-ins. Won't this be an ABI breaking change? The main question is: can we link static libraries produced by the old compiler using new compiler?
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.
Yes it would be an ABI breakage for device code and we can't link link static libraries produced by the old compiler using new compiler.
Should I keep all the existing implementation?
We probably need to add note for either removal or deprecation in upcoming release notes.
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.
Should I keep all the existing implementation?
Yes. We should keep old implementation to maintain stable ABI as required by the Contribution guidelines.
I'm not sure about release notes. This is implementation detail, which is not visible to users. We are allowed to break ABI with major version changes.
@AlexeySachkov, FYI.
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.
added back old implementations.
hvdijk
left a comment
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.
The NativeCPU changes look fine but will conflict with #17408, are you okay with trying to get that one in first, and then updating this?
clang/test/CodeGenSPIRV/spirv-builtin-lookup-intel-subgroup.cpp
Outdated
Show resolved
Hide resolved
Thanks for the review. I'll follow-up this issue later.
removed in c750ebf |
|
thank you @uwedolinsky |
hvdijk
left a comment
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.
The NativeCPU part looks good, thanks.
|
@intel/llvm-reviewers-runtime please review, thanks. |
Motivation is similar to c040f9a : unify with SPV-IR mangling.
SubgroupBlockReadINTEL is not handled in this PR. SPV-IR appends return type to mangled function name. It might be simpler for SYCL header to keep current mangling.