diff options
author | Matt Arsenault <Matthew.Arsenault@amd.com> | 2016-07-22 17:01:15 +0000 |
---|---|---|
committer | Matt Arsenault <Matthew.Arsenault@amd.com> | 2016-07-22 17:01:15 +0000 |
commit | d40ded6681c486acf53eabace2a186eb154bab33 (patch) | |
tree | 994b8e94cb1300ada4127d6bec042ce3280b903b /llvm/lib/Target/AMDGPU | |
parent | bd5054602ebad1d9d1a0753980c69ae6e08a168e (diff) | |
download | bcm5719-llvm-d40ded6681c486acf53eabace2a186eb154bab33.tar.gz bcm5719-llvm-d40ded6681c486acf53eabace2a186eb154bab33.zip |
AMDGPU: Don't reinvent transferSuccessorsAndUpdatePHIs
llvm-svn: 276434
Diffstat (limited to 'llvm/lib/Target/AMDGPU')
-rw-r--r-- | llvm/lib/Target/AMDGPU/SIISelLowering.cpp | 28 |
1 files changed, 2 insertions, 26 deletions
diff --git a/llvm/lib/Target/AMDGPU/SIISelLowering.cpp b/llvm/lib/Target/AMDGPU/SIISelLowering.cpp index 3cdb17036bf..4beae3d31ce 100644 --- a/llvm/lib/Target/AMDGPU/SIISelLowering.cpp +++ b/llvm/lib/Target/AMDGPU/SIISelLowering.cpp @@ -1072,24 +1072,6 @@ unsigned SITargetLowering::getRegisterByName(const char* RegName, EVT VT, + StringRef(RegName) + "\".")); } -static void replaceSuccessorPhisWith(MachineBasicBlock &BB, - MachineBasicBlock &SplitBB) { - for (MachineBasicBlock *Succ : BB.successors()) { - for (MachineInstr &MI : *Succ) { - if (!MI.isPHI()) - break; - - for (unsigned I = 2, E = MI.getNumOperands(); I != E; I += 2) { - MachineOperand &FromBB = MI.getOperand(I); - if (&BB == FromBB.getMBB()) { - FromBB.setMBB(&SplitBB); - break; - } - } - } - } -} - // If kill is not the last instruction, split the block so kill is always a // proper terminator. MachineBasicBlock *SITargetLowering::splitKillBlock(MachineInstr &MI, @@ -1109,14 +1091,10 @@ MachineBasicBlock *SITargetLowering::splitKillBlock(MachineInstr &MI, MachineBasicBlock *SplitBB = MF->CreateMachineBasicBlock(BB->getBasicBlock()); - // Fix the block phi references to point to the new block for the defs in the - // second piece of the block. - replaceSuccessorPhisWith(*BB, *SplitBB); - MF->insert(++MachineFunction::iterator(BB), SplitBB); SplitBB->splice(SplitBB->begin(), BB, SplitPoint, BB->end()); - SplitBB->transferSuccessors(BB); + SplitBB->transferSuccessorsAndUpdatePHIs(BB); BB->addSuccessor(SplitBB); MI.setDesc(TII->get(AMDGPU::SI_KILL_TERMINATOR)); @@ -1237,13 +1215,11 @@ static MachineBasicBlock *loadM0FromVGPR(const SIInstrInfo *TII, MF->insert(MBBI, LoopBB); MF->insert(MBBI, RemainderBB); - replaceSuccessorPhisWith(MBB, *RemainderBB); - LoopBB->addSuccessor(LoopBB); LoopBB->addSuccessor(RemainderBB); // Move the rest of the block into a new block. - RemainderBB->transferSuccessors(&MBB); + RemainderBB->transferSuccessorsAndUpdatePHIs(&MBB); RemainderBB->splice(RemainderBB->begin(), &MBB, I, MBB.end()); MBB.addSuccessor(LoopBB); |