LLVM Clang Lands Initial SPIR-V Toolchain Support
An exciting LLVM development has landed in time for Christmas! Complementary to the LLVM SPIR-V back-end work that could soon be mainlined, Clang has now merged the initial SPIR-V toolchain support. This allows going from Clang to the SPIR-V intermediate representation that is conformant to the OpenCL environment specification -- such as for compiling OpenCL kernels into SPIR-V.
Without the LLVM SPIR-V back-end itself being merged yet, the Clang SPIR-V toolchain relies upon the external LLVM to SPIR-V translator (llvm-spirv) for the conversion process. Once that big SPIR-V back-end is merged and in good standing, it can transition to using that within the LLVM code-base rather than requiring the external llvm-spirv tool.
This toolchain support allows generating SPIR-V binaries for 32-bit or 64-bit targets. The SPIR-V generation targets the OpenCL Environment Specification while could be extended for Vulkan, etc.
With the external llvm-spirv doing much of the heavy lifting, the Clang toolchain support is just over 200 lines of code and had been under review since October while now will be part of LLVM 14.0 next year.
With the HIPSPV code being merged this month too for going from AMD HIP to SPIR-V, December has been a great month so far for the open-source LLVM stack.
Without the LLVM SPIR-V back-end itself being merged yet, the Clang SPIR-V toolchain relies upon the external LLVM to SPIR-V translator (llvm-spirv) for the conversion process. Once that big SPIR-V back-end is merged and in good standing, it can transition to using that within the LLVM code-base rather than requiring the external llvm-spirv tool.
This toolchain support allows generating SPIR-V binaries for 32-bit or 64-bit targets. The SPIR-V generation targets the OpenCL Environment Specification while could be extended for Vulkan, etc.
Targeting SPIR-V is now possible from mainline Clang.
With the external llvm-spirv doing much of the heavy lifting, the Clang toolchain support is just over 200 lines of code and had been under review since October while now will be part of LLVM 14.0 next year.
With the HIPSPV code being merged this month too for going from AMD HIP to SPIR-V, December has been a great month so far for the open-source LLVM stack.
2 Comments