[LLVMdev] Need guidance regarding MachineFunctionPass implementation

John Criswell jtcriswel at gmail.com
Wed Sep 17 16:21:54 PDT 2014


Dear Sachin,

You will want to read up on the LLVM Code Generator infrastructure: 
http://llvm.org/docs/CodeGenerator.html#machine-code-description-classes

Also, a MachineFunctionPass is nearly the same as an LLVM FunctionPass 
except that it operations on MachineFunction objects instead of Function 
objects.  If you read the "Writing an LLVM Pass" document 
(http://llvm.org/docs/WritingAnLLVMPass.html) and understand how to use 
MachineInstr's, MachineBasicBlocks, and MachineInstr's, you should be 
able to figure it out.

Finally, take a look at the doxygen documentation anytime you need 
details on how to use a specific LLVM class, and as David suggested, 
take a look at existing code.

Regards,

John Criswell


On 9/17/14, 4:44 PM, sachin arora wrote:
> Hello all,
>
> I need to modify llvm bytecode / native code just before it is emitted 
> i.e. after all the regular operations and optimizations are done. I 
> was told that this can be achieved by implementing a MachineFunctionPass.
> I searched the internet for some tutorials or some example 
> MachineFunctionPass but found nothing. Kindly point some links, or 
> anything that may help. Thank you.
>
> 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/20140917/0f0ef00f/attachment.html>


More information about the llvm-dev mailing list