[LLVMdev] [RFC] Upstreaming LLVM/SPIR-V converter

Chris Lattner clattner at apple.com
Tue May 19 09:29:59 PDT 2015


> On May 19, 2015, at 1:25 AM, Neil Henning <llvm at duskborn.com> wrote:
> 
> The problem is - as Sean and Pete (and others before) have pointed out, from a users perspective they'll want to say 'clang make me SPIR-V'. There are things in SPIR-V that are not representable by the LLVM IR, so we'd have to add SPIR-V specific intrinsics for this (again making the case for having it as a target more palatable), and also there are things in the IR that won't be allowed when producing SPIR-V (off the top of my head, in a graphics shader with logical addressing mode a ton of pointer use is banned).
> 
> I think what Sean suggested of having a very thin backend that satisfies what a user will want when producing SPIR-V + setting up the target specific intrinsics, and then the majority of the actual SPIR-V production code being in lib/SPIRV sounds like a good approach to me!

There are two different things going on here:

1) Where the code lives in the llvm tree.
2) How clang and other tools expose it to users.

Per #1, it is pretty clear to me that this is a serialization format and should be structured like the bitcode reader & writer.  It is not a target, though maybe it also need a minimal target (but not instruction selection tables etc) so that clang and other tools can generate code for it.

Per #2, that is a discussion for the clang lists.

-Chris





More information about the llvm-dev mailing list