-
Notifications
You must be signed in to change notification settings - Fork 787
[SYCL] Add supplemental tool for SPIR-V to LLVM-IR conversions #5157
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
Conversation
Tool name: spir-to-ir Function: Provides an interface used within the compiler driver toolchain which converts SPIR-V to LLVM-IR. Using llvm-spirv as the main conversion tool, the purpose of this is to be able to take binaries and convert them to LLVM-IR. The conversion only takes place if the input is SPIR-V, and if the LLVM-IR is provided it is simply copied and passed through. This tool is useful for handling generated fat objects/archives that contain SPIR-V as opposed to typical LLVM-IR. We do not now the type of files within the device objects, so we use this tool to make sure that file consumed after unbundling is always LLVM-IR. Example usage: spir-to-ir input.spv -o output.bc // creates LLVM-IR output.bc spir-to-ir input.bc -o output.bc // no conversion, creates output.bc
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.
High-level implementation looks perfectly fine, a couple on-the-go thoughts added as comments
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 implementation LGTM! On top of the @intel/llvm-reviewers-runtime approval, conceptual approvals from @AlexeySachkov, @AlexeySotkin would be really appreciated.
SPIR and SPIR-V are quite different things. I'd recommend to rename |
@intel/llvm-reviewers-runtime, ping. |
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.
Conceptually LGTM, since the option for the translator to silently do nothing in reverse translation if input is already LLVM IR was rejected in the upstream.
@mdtoguchi, build with linking shared LLVM libraries has failed in post-commit. Please, take a look. |
Tool name:
spirv-to-ir-wrapper
Function:
Provides an interface used within the compiler driver toolchain which
converts SPIR-V to LLVM-IR. Using llvm-spirv as the main conversion
tool, the purpose of this is to be able to take binaries and convert
them to LLVM-IR. The conversion only takes place if the input is
SPIR-V, and if the LLVM-IR is provided it is simply copied and
passed through.
This tool is useful for handling generated fat objects/archives that
contain SPIR-V as opposed to typical LLVM-IR. We do not know the
type of files within the device objects, so we use this tool to make
sure that file consumed after unbundling is always LLVM-IR.
Example usage:
spirv-to-ir-wrapper input.spv -o output.bc // creates LLVM-IR output.bc
spirv-to-ir-wrapper input.bc -o output.bc // no conversion, creates output.bc