[LLVMdev] Is it necessary to implement the whole backend in order to add a new "pass" to the backend ?

sachin arora sachin345678 at gmail.com
Sat Sep 13 11:18:26 PDT 2014


Respected Sir,

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.

Regards,
Sachin

On Sat, Sep 13, 2014 at 11:55 AM, John Criswell <criswell at illinois.edu>
wrote:

>  Dear Sachin,
>
> 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)?
>
> 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.
>
> Regards,
>
> John Criswell
>
>
> On 9/12/14, 6:45 PM, sachin arora wrote:
>
> Hello all,
>
>  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.
> 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 !
>
>  Regards,
> Sachin
>
>
> _______________________________________________
> LLVM Developers mailing listLLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.eduhttp://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140913/58693211/attachment.html>


More information about the llvm-dev mailing list