Not all custom inserters create new basic blocks. If the inserter
didn't create a new block, don't reset the insert position. llvm-svn: 107813
This commit is contained in:
parent
41a3c9a5f8
commit
25d5c1b4f8
|
@ -732,8 +732,11 @@ EmitMachineNode(SDNode *Node, bool IsClone, bool IsCloned,
|
|||
if (II.usesCustomInsertionHook()) {
|
||||
// Insert this instruction into the basic block using a target
|
||||
// specific inserter which may returns a new basic block.
|
||||
MBB = TLI->EmitInstrWithCustomInserter(MI, MBB);
|
||||
InsertPos = MBB->end();
|
||||
MachineBasicBlock *NewMBB = TLI->EmitInstrWithCustomInserter(MI, MBB);
|
||||
if (NewMBB != MBB) {
|
||||
MBB = NewMBB;
|
||||
InsertPos = NewMBB->end();
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue