[LLVMdev] Changing basic blocks

Tanya M. Lattner tonic at nondot.org
Wed Aug 8 16:39:07 PDT 2007


> I need a way to reorder instructions inside MachineBasicBlocks or
> MachineFunctions.
> I've been searching for it but I have not found an example in the code yet.

For MachineBasicBlocks, check out this doc:
http://llvm.org/doxygen/classllvm_1_1MachineBasicBlock.html

I believe its basically the same as basic blocks in that you can 
manipulate the instruction list.

Otherwise, you need to write a MachineFunction Pass:
http://llvm.org/docs/WritingAnLLVMPass.html#MachineFunctionPass

-Tanya



More information about the llvm-dev mailing list