<div dir="ltr">Respected Sir,<div><br><div>Thank you for your response. By LR I mean LLVM IR with all the optimizations done. For instance I call Register Transfer Language of GCC an LR because it is produced after some optimizations are performed on the IR. For my project I need to make some changes to this LR so that the outputted native code has certain additional features. In your reply you say that I need to implement only a MachineFunctionPass to achieve this; that's all I needed to know. Thanks again.</div><div><br></div><div>Regards,</div><div>Sachin <br></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Sep 13, 2014 at 11:55 AM, John Criswell <span dir="ltr"><<a href="mailto:criswell@illinois.edu" target="_blank">criswell@illinois.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000">
<div>Dear Sachin,<br>
<br>
First, it's not clear to me what you mean by "LR." Do you mean
that you want to modify the LLVM Intermediate Representation (the
LLVM IR)?<br>
<br>
Assuming you're wanting to transform code with LLVM, then answer
is no. You can implement a pass that performs the
transformation/optimization you want and add it to the compiler.
If you need to modify the code generation portions of LLVM, you
can write a MachineFunctionPass that modifies the native code
generated by LLVM after LLVM has done instruction selection,
instruction scheduling, and register allocation but before
emitting the final assembly/object file.<br>
<br>
Regards,<br>
<br>
John Criswell<div><div class="h5"><br>
<br>
On 9/12/14, 6:45 PM, sachin arora wrote:<br>
</div></div></div>
<blockquote type="cite"><div><div class="h5">
<div dir="ltr">Hello all,
<div><br>
</div>
<div>I am new to llvm. I need to make some changes to the LR.
The backend should modify the LR, but only after all the
normal work and all the optimizations are done. </div>
<div>Just before outputting the native code, LR is modified. I
was wondering if I should implement the whole backend in order
to achieve this or is it possible to implement a new pass and
use that. Thanks !</div>
<div><br>
</div>
<div>Regards,</div>
<div>Sachin </div>
</div>
<br>
<fieldset></fieldset>
<br>
</div></div><pre>_______________________________________________
LLVM Developers mailing list
<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>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a>
</pre>
</blockquote>
<br>
</div>
</blockquote></div><br></div>