[llvm-dev] Inserting a new MachineBasicBlock between two existing MachineBasicBlocks
Ziqiang Patrick Huang via llvm-dev
llvm-dev at lists.llvm.org
Mon Aug 17 14:26:59 PDT 2015
Suppose I have two basicblock A->B, and I wanted to insert C between them
so that A->B->C.
By looking at MachineBasicBlock::SplitCriticalEdge, I did following similar
MachineBasicBlock *B = MF.CreateMachineBasicBlock();
But when I try to add the new basicblock into SlotIndexes, it fails at the
assert(unsigned(mbb->getNumber()) == MBBRanges.size() && "Blocks must be
added in order");
So I thought maybe I should add it at the end of the function, so I tried
MF.insert(MF.end(), B), but it still fails, so I'm wondering what's the
right way to do it.
I'm doing it at MachineScheduler Pass.
Thanks in Advance
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the llvm-dev