[LLVMdev] Changing order of instructions

Evandro Menezes emenezes at codeaurora.org
Tue Dec 6 13:51:07 PST 2011

Given a segment of a MachineBasicBlock containing the instructions [MI4, 
MI5, MI6] at an arbitrary point, what would be the best way to change 
this segment with the same instructions in a different order, say, [MI5, 
MI6, MI4]?

I looked into splice(), but it was impossible to hold iterators that 
remained valid before and after the splicing.  I tried erase/remove() 
with insert/insertAfter(), but I ended up with the instructions being 


Evandro Menezes        Austin, TX        emenezes at codeaurora.org
Qualcomm Innovation Center, Inc is a member of Code Aurora Forum

More information about the llvm-dev mailing list