[LLVMdev] Writing a pass that modifies the IR

Edmund Grimley-Evans Edmund.Grimley-Evans at arm.com
Mon Aug 2 03:38:04 PDT 2010

Could some kind soul point me at the documentation, or the appropriate header file, or an example of the best way to write a pass that modifies the IR?

Suppose, for example, that I wanted to replace every call to the intrinsic i1 with a call to i2 followed by a call to i3: i1(X) -> i3(i2(X))

I'm currently playing around with a class that inherits from FunctionPass and InstVisitor and I can add instructions but I'm not yet able to use the output from the new instruction. I suspect there's a much easier way of doing what I want to do.

IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium.  Thank you.

More information about the llvm-dev mailing list