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

David Chisnall David.Chisnall at cl.cam.ac.uk
Tue May 19 14:38:54 PDT 2015


On 19 May 2015, at 12:40, 罗勇刚(Yonggang Luo) <luoyonggang at gmail.com> wrote:
> 
> From my points of view, there is two different of roles along with SPIR-V.
> 1, As a backend of clang, in this way, maybe we treat SPIR-V as a llvm
> backend is the easiest way to implement, but that not agree with the
> nature of SPIR-V, it's a IR(intermediate representation) , and Target
> means the machine level abstraction. Anyway, we also have Asm.js and
> CppBackend have same feature.

I think that this should be generalised.  It’s not just clang that is likely to be generating SPIR-V - other DSL compilers that want to run code on the GPU are likely to as well, along with existing things (I wouldn’t be surprised to see Julia generate SPIR-V, for example).

There are therefore two questions:

- How will clang expose this to users (cfe-dev question)?
- How will SPIR generation be exposed to front-end developers in general?

> 2, As a frontend IR, it's would first translate to LLVM IR, and then
> translate to Target Machine.

There may also be a third case of things that both consume and produce SPIR-V.  Things that are the moral equivalent of linkers may fit in this, as may code obfuscation tools, and more traditional optimisers.

David





More information about the llvm-dev mailing list