Hello.<br><br>Thank you for your advice.<br><br>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.<br>
<br> <br><div class="gmail_quote">On Mon, Jan 4, 2010 at 2:09 PM, David Greene <span dir="ltr"><<a href="mailto:dag@cray.com" target="_blank">dag@cray.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div>On Sunday 03 January 2010 01:00, Chris Lattner wrote:<br>
> On Jan 1, 2010, at 12:51 PM, mmms1841 wrote:<br>
> > I am trying to understand how LLVM does code generation and I have a<br>
> > couple of questions. I am using LLVM 2.6.<br>
> ><br>
> > First,<br>
> > if I want to change the name of an instruction, all I need to do is to<br>
> > modify the XXXInstrInfo.td, right? Using Sparc as an example, if I<br>
> > wanted to output "mysra" instead of "sra", in SparcInstrInfo.td, I would<br>
> > write,<br>
> ><br>
> > defm SRA : F3_12<"mysra", 0b100111, sra>;<br>
> ><br>
> > Is this correct?<br>
><br>
> Yes.<br>
<br>
</div>IMHO, this is a poor way to do this kind of thing. It eventually<br>
leads to confusion where someone things SRA means "sra" and someone<br>
else thinks it meas "mysra." It gets worse as "mysra" acquires<br>
subtly different semantics than "sra." Better to write a separate pattern<br>
and use AddedComplexity to prefer it.<br>
<br>
Just a nugget of wisdom from personal experience. :)<br>
<br>
-Dave<br>
<div><div></div><div>_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:LLVMdev@cs.uiuc.edu" target="_blank">LLVMdev@cs.uiuc.edu</a> <a href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>
</div></div></blockquote></div><br>