mirror of
https://github.com/RPCS3/llvm.git
synced 2025-02-13 14:46:15 +00:00
Use MachineBasicBlock::transferSuccessors.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52594 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
933e51c5e3
commit
0011dc4738
@ -662,11 +662,7 @@ AlphaTargetLowering::EmitInstrWithCustomInserter(MachineInstr *MI,
|
|||||||
MachineBasicBlock *llscMBB = new MachineBasicBlock(LLVM_BB);
|
MachineBasicBlock *llscMBB = new MachineBasicBlock(LLVM_BB);
|
||||||
MachineBasicBlock *sinkMBB = new MachineBasicBlock(LLVM_BB);
|
MachineBasicBlock *sinkMBB = new MachineBasicBlock(LLVM_BB);
|
||||||
|
|
||||||
for(MachineBasicBlock::succ_iterator i = thisMBB->succ_begin(),
|
sinkMBB->transferSuccessors(thisMBB);
|
||||||
e = thisMBB->succ_end(); i != e; ++i)
|
|
||||||
sinkMBB->addSuccessor(*i);
|
|
||||||
while(!thisMBB->succ_empty())
|
|
||||||
thisMBB->removeSuccessor(thisMBB->succ_begin());
|
|
||||||
|
|
||||||
MachineFunction *F = BB->getParent();
|
MachineFunction *F = BB->getParent();
|
||||||
F->getBasicBlockList().insert(It, llscMBB);
|
F->getBasicBlockList().insert(It, llscMBB);
|
||||||
|
@ -4018,15 +4018,10 @@ PPCTargetLowering::EmitInstrWithCustomInserter(MachineInstr *MI,
|
|||||||
MachineFunction *F = BB->getParent();
|
MachineFunction *F = BB->getParent();
|
||||||
F->getBasicBlockList().insert(It, copy0MBB);
|
F->getBasicBlockList().insert(It, copy0MBB);
|
||||||
F->getBasicBlockList().insert(It, sinkMBB);
|
F->getBasicBlockList().insert(It, sinkMBB);
|
||||||
// Update machine-CFG edges by first adding all successors of the current
|
// Update machine-CFG edges by transferring all successors of the current
|
||||||
// block to the new block which will contain the Phi node for the select.
|
// block to the new block which will contain the Phi node for the select.
|
||||||
for(MachineBasicBlock::succ_iterator i = BB->succ_begin(),
|
sinkMBB->transferSuccessors(BB);
|
||||||
e = BB->succ_end(); i != e; ++i)
|
// Next, add the true and fallthrough blocks as its successors.
|
||||||
sinkMBB->addSuccessor(*i);
|
|
||||||
// Next, remove all successors of the current block, and add the true
|
|
||||||
// and fallthrough blocks as its successors.
|
|
||||||
while(!BB->succ_empty())
|
|
||||||
BB->removeSuccessor(BB->succ_begin());
|
|
||||||
BB->addSuccessor(copy0MBB);
|
BB->addSuccessor(copy0MBB);
|
||||||
BB->addSuccessor(sinkMBB);
|
BB->addSuccessor(sinkMBB);
|
||||||
|
|
||||||
|
@ -920,15 +920,10 @@ SparcTargetLowering::EmitInstrWithCustomInserter(MachineInstr *MI,
|
|||||||
MachineFunction *F = BB->getParent();
|
MachineFunction *F = BB->getParent();
|
||||||
F->getBasicBlockList().insert(It, copy0MBB);
|
F->getBasicBlockList().insert(It, copy0MBB);
|
||||||
F->getBasicBlockList().insert(It, sinkMBB);
|
F->getBasicBlockList().insert(It, sinkMBB);
|
||||||
// Update machine-CFG edges by first adding all successors of the current
|
// Update machine-CFG edges by transferring all successors of the current
|
||||||
// block to the new block which will contain the Phi node for the select.
|
// block to the new block which will contain the Phi node for the select.
|
||||||
for(MachineBasicBlock::succ_iterator i = BB->succ_begin(),
|
sinkMBB->transferSuccessors(BB);
|
||||||
e = BB->succ_end(); i != e; ++i)
|
// Next, add the true and fallthrough blocks as its successors.
|
||||||
sinkMBB->addSuccessor(*i);
|
|
||||||
// Next, remove all successors of the current block, and add the true
|
|
||||||
// and fallthrough blocks as its successors.
|
|
||||||
while(!BB->succ_empty())
|
|
||||||
BB->removeSuccessor(BB->succ_begin());
|
|
||||||
BB->addSuccessor(copy0MBB);
|
BB->addSuccessor(copy0MBB);
|
||||||
BB->addSuccessor(sinkMBB);
|
BB->addSuccessor(sinkMBB);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user