[LLVMdev] Enabling SPIR target in LLVM 3.3
Rahul Garg
rahulgarg44 at gmail.com
Fri Sep 5 12:50:03 PDT 2014
Thanks. I am not trying to modify convert generic LLVM IR and know the
requirements (such as specifying address spaces etc.). I guess I just
need to ensure that I am sticking to LLVM 3.2 and the SPIR specified
subset+ metadata annotations etc.
Anyway, I was confused partly because there are references to a SPIR
backend in LLVM code (eg: include/llvm/ADT/Triple.h lists spir and
spir64 as possible architectures)
rahui
On Fri, Sep 5, 2014 at 2:55 PM, Tim Northover <t.p.northover at gmail.com> wrote:
> 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