Intel Looking To Upstream A Proper SPIR-V Compute Back-End For LLVM

Written by Michael Larabel in Intel on 2 March 2021 at 08:46 AM EST. 2 Comments
INTEL
It's been talked about many times from various parties but so far has remained elusive from the mainline LLVM code-base: a SPIR-V back-end for LLVM that would go from LLVM into this Khronos intermediate representation most notably used by OpenCL and Vulkan drivers. Intel engineers are stepping up and hope to help get a proper SPIR-V back-end upstreamed into LLVM.

There have been various out-of-tree efforts and plans talked about by different companies/developers for having a SPIR-V back-end in LLVM as this key IR supported by the modern Khronos APIs. With Intel's latest push and "request for comments", they are looking to have a proper back-end in LLVM for targeting SPIR-V -- initially with a compute focus but the possibility of extending to 3D shader support for Vulkan later on.

There have been differing opinions before on how such a LLVM to SPIR-V back-end should look while with the proposed Intel approach would be a "true" back-end design. The starting point if agreed on would be existing Khronos code and as mentioned to initially focus on OpenCL/compute use-cases.

If all goes well, the Intel engineers hope to be able to upstream an "experimental" SPIR-V back-end into the LLVM repository within the next few months.

See this mailing list thread for those interested. The early back-end code is being developed via this Khronos GitHub repository.

So far in the resulting discussion questions have been raised over LLVM's MLIR SPIR-V back-end and its future should this LLVM back-end come to pass. But for now the MLIR SPIR-V code is mostly focused on Vulkan while this proposed LLVM SPIR-V back-end is more minded for OpenCL/compute usage, so at least in the near term both efforts might co-exist. In any case if this new LLVM back-end pans out, it could help in allowing for existing code currently being passed through to LLVM front-ends like Clang to be re-targeted for OpenCL/GPU usage.
Related News
About The Author
Michael Larabel

Michael Larabel is the principal author of Phoronix.com and founded the site in 2004 with a focus on enriching the Linux hardware experience. Michael has written more than 20,000 articles covering the state of Linux hardware support, Linux performance, graphics drivers, and other topics. Michael is also the lead developer of the Phoronix Test Suite, Phoromatic, and OpenBenchmarking.org automated benchmarking software. He can be followed via Twitter, LinkedIn, or contacted via MichaelLarabel.com.

Popular News This Week