[llvm-commits] [RFC] PPC64 TOC and MCJIT support

Roman Divacky rdivacky at freebsd.org
Wed Aug 8 11:20:55 PDT 2012


On Wed, Aug 08, 2012 at 02:30:15PM -0300, Adhemerval Zanella wrote:
> 
> On 08/06/2012 03:49 PM, Roman Divacky wrote:
> > Wow, this looks awesome, some parts of this (adding of enums and handling them)
> > can be committed as is. Maybe you can split them into logical chunks? Ie.
> > "Handle ELF::PPC{64} in ELF" etc. The TOC handling changes look fine to me.
> > The LDtoc* stuff too. I cant comment on the JIT part.
> 
> Ok, I'll finish some work on relocation before. I found out that for small toc
> model, the one I'm targeting now, it need some adjustments. I will also split
> up the patch in parts, maybe one for changes in 'include/llvm', another for
> TOC relocation and another fro JIT support.
 
 
Ok, but please split the patch into logical chunks not only dirs. 

> > the OutStreamer.hasRawTextSupport() is needed because we emit ".tc"
> >
> > would this be a right thing to do?
> >
> > -      OutStreamer.EmitRawText("\t.tc " + Twine(I->first->getName()) +
> > -                              "[TC]," + I->first->getName());
> > +      MCSymbol *S = OutContext.GetOrCreateSymbol(I->first->getName());
> > +      OutStreamer.EmitValue(MCSymbolRefExpr::Create(S, OutContext),
> > +                            Subtarget.isPPC64() ? 8 : 4/*size*/, 0/*addrspace*/);
> >
> I added it for MCJIT support (without my change the .LC0_X emit constant
> triggers an error of double creation). I might be wrong and please correct me
> if I were, but since the stream class used for MCJIT does not support 
> raw text and it does not need .tc directives, I believe the my code is
> fine.

I am not questioning your change, I just think that mine is better :)
First, it doesnt blindly create the symbol, but reuses one if it already
exists and second, it enables the use of the integrated asm to directly 
produce object files. Can you test if it works for you? If so, I'd prefer
my change.

Thank you! roman



More information about the llvm-commits mailing list