Khronos Officially Announces Its LLVM/SPIR-V Translator
The Khronos Group has officially announced the long-awaited open-source availability of their SPIRV-LLVM-Translator that allows the bi-directional translation of SPIR-V and LLVM IR.
The SPIRV-LLVM-Translator allows taking Vulkan/OpenCL SPIR-V and translating it into native LLVM IR for consumption by the diverse components in the LLVM ecosystem. Likewise, you can go from the LLVM intermediate representation and output to SPIR-V for consumption then by SPIR-V/Vulkan drivers. This bi-directional translator opens up SPIR-V to a range of interesting new options.
This translator can also work with the Khronos OpenCL C compiler for turning the code into SPIR-V. The SPIRV-LLVM-Translator provides the llvm-spirv tool for offline translation from LLVM bitcode to/from SPIR-V. The tool can also provide debugging information and dumping SPIR-V in a textual format for debugging.
The code to the SPIRV-LLVM-Translator can be found via GitHub. Ultimately, Khronos members continue pursuing a SPIR-V back-end within LLVM itself, but for now there is this standalone translator and hopefully it won't be too much longer before seeing official SPIR-V support within LLVM.
The SPIRV-LLVM-Translator allows taking Vulkan/OpenCL SPIR-V and translating it into native LLVM IR for consumption by the diverse components in the LLVM ecosystem. Likewise, you can go from the LLVM intermediate representation and output to SPIR-V for consumption then by SPIR-V/Vulkan drivers. This bi-directional translator opens up SPIR-V to a range of interesting new options.
This translator can also work with the Khronos OpenCL C compiler for turning the code into SPIR-V. The SPIRV-LLVM-Translator provides the llvm-spirv tool for offline translation from LLVM bitcode to/from SPIR-V. The tool can also provide debugging information and dumping SPIR-V in a textual format for debugging.
The code to the SPIRV-LLVM-Translator can be found via GitHub. Ultimately, Khronos members continue pursuing a SPIR-V back-end within LLVM itself, but for now there is this standalone translator and hopefully it won't be too much longer before seeing official SPIR-V support within LLVM.
4 Comments