[LLVMdev] Assembly Printer

mmms1841 mmms1841 at gmail.com
Mon Jan 4 19:27:53 PST 2010


Hello.

Thank you for your advice.

I am still trying to understand how code generation works and see how the
changes I made in the .td files affect the output. I have managed to see the
names of the instructions change in the output (it turns out it was a
linkage problem), and right now I am trying to figure out how function call
lowering works. If I get to the point where I can start implementing a real
backend, I will certainly change the definition and everything else.


On Mon, Jan 4, 2010 at 2:09 PM, David Greene <dag at cray.com> wrote:

> On Sunday 03 January 2010 01:00, Chris Lattner wrote:
> > On Jan 1, 2010, at 12:51 PM, mmms1841 wrote:
> > > I am trying to understand how LLVM does code generation and I have a
> > > couple of questions. I am using LLVM 2.6.
> > >
> > > First,
> > > if I want to change the name of an instruction,  all I need to do is to
> > > modify the XXXInstrInfo.td, right? Using Sparc as an example,  if I
> > > wanted to output "mysra" instead of "sra", in SparcInstrInfo.td, I
> would
> > > write,
> > >
> > > defm SRA : F3_12<"mysra", 0b100111, sra>;
> > >
> > > Is this correct?
> >
> > Yes.
>
> IMHO, this is a poor way to do this kind of thing.  It eventually
> leads to confusion where someone things SRA means "sra" and someone
> else thinks it meas "mysra."  It gets worse as "mysra" acquires
> subtly different semantics than "sra."  Better to write a separate pattern
> and use AddedComplexity to prefer it.
>
> Just a nugget of wisdom from personal experience.  :)
>
>                            -Dave
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20100104/9ed845bd/attachment.html>


More information about the llvm-dev mailing list