[LLVMdev] Help with PPC64 JIT

Hal Finkel hfinkel at anl.gov
Tue Jul 31 08:35:02 PDT 2012


On Tue, 31 Jul 2012 11:43:28 -0300
Adhemerval Zanella <azanella at linux.vnet.ibm.com> wrote:

> On 07/31/2012 11:26 AM, Adhemerval Zanella wrote:
> > On 07/20/2012 10:35 AM, Will Schmidt wrote:
> >> On Fri, 2012-07-20 at 08:36 +0200, Duncan Sands wrote:
> >>> Hi Adhemerval Zanella, the old JIT infrastructure is going away,
> >>> to be replaced by "MC-JIT" (try passing -use-mcjit to lli).  It
> >>> sounds like you are working on the old JIT, so I suggest you work
> >>> instead on getting MC-JIT working on powerpc.
> >> Hi Duncan, 
> >>    Thanks for the pointers.  We hadn't stumbled across the MC-JIT
> >> refs in our digging so far.  (LLVM GettingStarted.html doesn't
> >> mention it, and (FIXME: T.B.D.) under llvm/lib/mc, so I suppose
> >> the MC jit is fairly recent?)
> >> Are we safe to assume the old JIT infrastructure will be completely
> >> replaced, or are there likely to be 'users' that may still need
> >> functionality?
> >> I imagine since the old jit is where Adhemerval was focused, the
> >> build/test steps must still be referencing it.
> >>
> >> Thanks, 
> >> -Will 
> > Thanks for the reply Duncan, I shifted my focus fo MCJIT. So far I
> > could check there are basically two issues with MCJIT relating to
> > PPC64 support:
> >
> > 1. Looks like LLVM does not generate PPC64 PIC code with TOC
> > references. Using the testcase '2003-01-04-ArgumentBug.ll' I tried
> > to invoke the llc with '-march=ppc64 -mcpu=ppc64 -mattr=64bit' and
> > still uses the 32-bits relocations (@ha/@l(3)) where TOC would be
> > expected (@toc). I did some adjustments to JIT code and function
> > calling is correct (the function ODP is created and called), but
> > BSS access is still not right since the 64-bits relocations are not
> > done correctly. Could someone point where should I focus my efforts
> > to add TOC support on PowerPC backend?
> >
> > 2. Relocations: I could add some support for PPC32 relocations by
> > implementing some functions at 'RuntimeDyldELF.cpp', but then I
> > fall back again in 1. (the PPC64 support is incomplete). 
> >
> > Is my analysis correct or I am issuing llc/lli wrongly and not
> > activating the PPC64 PIC support? Anyone to advice me on this one?
> > Any help would be appreciated.
> >
> The modifications I have done so far are in attachments. Basically it
> adds the PPC64 machine name in Target, add some relocation support in
> Elf Runtime class. I'm still figuring out a lot of internal llvm and
> the patch is still WIP.

Great! Thanks for sharing this. I'll send comments on the patch to the
commits list.

 -Hal

> 
> 



-- 
Hal Finkel
Postdoctoral Appointee
Leadership Computing Facility
Argonne National Laboratory



More information about the llvm-dev mailing list