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

John Criswell criswell at illinois.edu
Sat Sep 13 09:55:06 PDT 2014


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 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/20140913/be5d77ae/attachment.html>


More information about the llvm-dev mailing list