[LLVMdev] Enabling SPIR target in LLVM 3.3

Tim Northover t.p.northover at gmail.com
Fri Sep 5 11:55:21 PDT 2014


Hi Rahul,

On 5 September 2014 19:21, Rahul Garg <rahulgarg44 at gmail.com> wrote:
> I am looking into generating SPIR from within a JIT compiler for a
> high level language using LLVM C++ API. The first step is to of course
> build LLVM with SPIR backend support and I am currently using LLVM
> 3.3.

As far as I know, there's no such thing as a SPIR backend, or the
ability to translate fully generic LLVM IR into SPIR. If you want to
generate SPIR, you have to know the restrictions it imposes and follow
them.

Where LLVM gets involved is that OpenCL compilers which accept SPIR
input will (probably) pass it on to the usual LLVM backends (x86, ARM,
bizare-GPU-43712) to translate into the appropriate machine code.

Also, be aware that LLVM changes quickly. SPIR still seems to be based
on version 3.2 which was nearly 2 years ago. You'd certainly hit
issues trying to mix it with modern LLVM IR, and I'd not want to risk
it with 3.3 either.

Cheers.

Tim.



More information about the llvm-dev mailing list