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

Neil Henning llvm at duskborn.com
Tue May 19 01:25:36 PDT 2015


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!

Cheers,
-Neil.

On 19/05/15 00:24, Owen Anderson wrote:
>
>> On May 18, 2015, at 2:09 PM, Sean Silva <chisophugis at gmail.com 
>> <mailto:chisophugis at gmail.com>> wrote:
>>
>> From an end-user's perspective it sounds like the use case for SPIR-V 
>> though is a lot more similar to a target though. E.g. the user is 
>> notionally telling clang "target SPIR-V" (including doing any IR 
>> optimizations, any special "codegenprepare" special passes, etc.), 
>> rather than "act like you're targeting X, but -emit-llvm/-emit-spirv 
>> instead" (which is what I imagine from a component purely in lib/SPIRV).
>>
>
> SPIR-V is a serialization format between the user’s frontend and the 
> vendor’s backend.  From the user’s perspective, it looks like a 
> target.  From the vendor’s perspective, it looks like a frontend.  In 
> this sense, it is very comparable to LLVM bitcode itself.
>
> —Owen
>
>
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev

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


More information about the llvm-dev mailing list