[llvm-dev] SPIRV-LLVM as an external tool

Nicholas Wilson via llvm-dev llvm-dev at lists.llvm.org
Wed Feb 28 18:42:26 PST 2018


On 1 Mar 2018, at 9:52 am, Chris Lattner via llvm-dev <llvm-dev at lists.llvm.org<mailto:llvm-dev at lists.llvm.org>> wrote:

On Feb 27, 2018, at 10:25 AM, Tom Stellard via llvm-dev <llvm-dev at lists.llvm.org<mailto:llvm-dev at lists.llvm.org>> wrote:
There is no requirement that the tool needs to be an official part of the LLVM
project to implement to use it this way  For example, the cuda toolchain
in clang relies on a few proprietary tools from NVIDIA.

I think too much emphasis is being placed on having this tool be part of the
LLVM project.

Agreed.  Why is it good for LLVM to include this tool?

If there was a strong rationale for doing so, it would probably make sense to be a new subproject of some sort rather than included in the main llvm repo (not sure if that is what was being proposed).

While what Tom has said may be true for clang, it is not the only frontend that wants to use this. LDC currently uses a fork of LLVM to generate SPIR-V it would be much nicer to be able to use the regular LLVM releases.

The converter (the tool being proposed) is effectively both a backend (LLVM IR -> SPIR-V), albeit not a conventional one, and a frontend (SPIR-V -> LLVM IR) and therefore needs a number of things from the LLVM repo such as its own triples (and intrinsics when we move away from the current system).
It being proposed as a tool is an intermediate step to a backend and a tool that calls some of the backends passes.

The rationale is to:
Provide a standard LLVM tooling with SPIR-V that benefits frontends through the SPIR-V backend to produce SPIR-V, and backends (CPU and GPU) through the SPIR-V frontend so that intrinsics can be translated (possibly a lá libclc?) and the triple changed and fed through the backend.
Reduce the fragmentation of the SPIR-V ecosystem, I know of at least three projects aiming to provide SPIR-V tooling for LLVM. Having one central project allows coordinated effort and ensures that the SPIR-V tooling stays up to date with LLVM.

Nic
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20180301/f361d0b5/attachment.html>


More information about the llvm-dev mailing list