[SYCL] Add supplemental tool for SPIR-V to LLVM-IR conversions#5157
[SYCL] Add supplemental tool for SPIR-V to LLVM-IR conversions#5157bader merged 11 commits intointel:syclfrom
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
AGindinson
left a comment
There was a problem hiding this comment.
High-level implementation looks perfectly fine, a couple on-the-go thoughts added as comments
AGindinson
left a comment
There was a problem hiding this comment.
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. |
AlexeySachkov
left a comment
There was a problem hiding this comment.
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