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

Ronan KERYELL ronan-list at keryell.fr
Mon May 18 16:14:07 PDT 2015


>>>>> On Mon, 18 May 2015 03:25:35 +0800, "罗勇刚(Yonggang Luo)"  <luoyonggang at gmail.com> said:

    罗勇刚(Yonggang> I feels SPIR-V doesn't like to be a backend, cause
    罗勇刚(Yonggang> it's can be translate to different target(Such as
    罗勇刚(Yonggang> NPTX and R600 or other GPU) But SPIR-V is not llvm
    罗勇刚(Yonggang> IR, cause SPIR-V is have something llvm-ir doesn't
    罗勇刚(Yonggang> have and removed something from llvm-ir.

SPIR-V is also a target because its goal is to have a portable .o in the
Khronos realm (OpenCL, OpenGL...).

The NVPTX <-> LLVM IR is interesting too. Combined with LLVM IR <-> SPIR V,
it opens some easier gateways between OpenCL and CUDA for example... :-)

    罗勇刚(Yonggang> So I think SPIR-V is another IR that seat between
    罗勇刚(Yonggang> the clang-frontend and llvm-IR.  Like C# IR or Java
    罗勇刚(Yonggang> ByteCodes does.  So clang -> SPIR-V -> LLVM-IR ->
    罗勇刚(Yonggang> Backends.  So

Even if we could imagine implementing it this way, it would unlikely
done this way because it would mean duplicating a lot of code in Clang.

So it is more likely Clang -> LLVM-IR <-> SPIR-V
-- 
  Ronan




More information about the llvm-dev mailing list