-
Notifications
You must be signed in to change notification settings - Fork 769
[SYCL][SPIR-V] Make clang lookup for SPIR-V builtins #1345
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
bader
merged 5 commits into
intel:sycl
from
codeplaysoftware:victor/spirv-builtin-agnostic-lookup
Mar 21, 2020
Merged
[SYCL][SPIR-V] Make clang lookup for SPIR-V builtins #1345
bader
merged 5 commits into
intel:sycl
from
codeplaysoftware:victor/spirv-builtin-agnostic-lookup
Mar 21, 2020
Conversation
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
4a91cf6
to
b07b2a8
Compare
bader
reviewed
Mar 20, 2020
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.
Looks good.
A few minor comments.
d020e7d
to
ce0d73f
Compare
Rename the OpenCL Builtin lookup system to make it agnostic. The Builtin emitter is now outputting the builtin information into a class so that different programming models can be produced and used. Signed-off-by: Victor Lomuller <victor@codeplay.com>
Add flag -fdeclare-spirv-builtins to enable lookup of SPIR-V builtins. If -fdeclare-spirv-builtins is passed to clang, the compiler will try to lookup for the builtin described in SPIRVBuiltins.td for any match. If a match is found, overloads are build for the match. Signed-off-by: Victor Lomuller <victor@codeplay.com>
Co-Authored-By: Alexey Bader <alexey.bader@intel.com> Signed-off-by: Victor Lomuller <victor@codeplay.com>
Signed-off-by: Victor Lomuller <victor@codeplay.com>
ce0d73f
to
2709339
Compare
bader
previously approved these changes
Mar 20, 2020
@Naghasan, could you update the Windows mangling in CodeGen test, please? |
Signed-off-by: Victor Lomuller <victor@codeplay.com>
@bader I tests updated |
bader
approved these changes
Mar 20, 2020
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.
Thanks!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This patch (2 commits) add the initial infrastructure to enable lookup of SPIR-V builtins by clang following a similar model as done for OpenCL.
The first commit is to make the OpenCL lookup agnostic to the programming model used. The second enables the path for them and add a dummy instructions as example. Other builtins will follow after this.
Down the line, this will enforce a stable way to express SPIR-V builtins and make them closer to how the translator mangles them. This will help ensuring builtin for CUDA does not break easily. This will also support any changes suggested by the SPIRV-LLVM people on how to represent builtins.
Signed-off-by: Victor Lomuller victor@codeplay.com