Lines Matching refs:MBB
73 bool EliminatePHINodes(MachineFunction &MF, MachineBasicBlock &MBB);
74 void LowerPHINode(MachineBasicBlock &MBB,
86 bool SplitPHIEdges(MachineFunction &MF, MachineBasicBlock &MBB,
91 bool isLiveIn(unsigned Reg, const MachineBasicBlock *MBB);
92 bool isLiveOutPastPHIs(unsigned Reg, const MachineBasicBlock *MBB);
146 for (auto &MBB : MF)
147 Changed |= SplitPHIEdges(MF, MBB, MLI);
154 for (auto &MBB : MF)
155 Changed |= EliminatePHINodes(MF, MBB);
186 MachineBasicBlock &MBB) {
187 if (MBB.empty() || !MBB.front().isPHI())
193 std::prev(MBB.SkipPHIsAndLabels(MBB.begin()));
195 while (MBB.front().isPHI())
196 LowerPHINode(MBB, LastPHIIt);
224 void PHIElimination::LowerPHINode(MachineBasicBlock &MBB,
231 MachineInstr *MPhi = MBB.remove(MBB.begin());
239 MachineFunction &MF = *MBB.getParent();
250 BuildMI(MBB, AfterPHIsIt, MPhi->getDebugLoc(),
266 BuildMI(MBB, AfterPHIsIt, MPhi->getDebugLoc(),
285 if (MachineInstr *OldKill = VI.findKill(&MBB)) {
288 DEBUG(MBB.dump());
315 SlotIndex MBBStartIndex = LIS->getMBBStartIdx(&MBB);
317 // Add the region from the beginning of MBB to the copy instruction to
333 // A dead PHI's live range begins and ends at the start of the MBB, but
343 // Otherwise, remove the region from the beginning of MBB to the copy
381 findPHICopyInsertPoint(&opBlock, &MBB, SrcReg);
538 for (const auto &MBB : MF)
539 for (const auto &BBI : MBB) {
549 MachineBasicBlock &MBB,
551 if (MBB.empty() || !MBB.front().isPHI() || MBB.isEHPad())
554 const MachineLoop *CurLoop = MLI ? MLI->getLoopFor(&MBB) : nullptr;
555 bool IsLoopHeader = CurLoop && &MBB == CurLoop->getHeader();
558 for (MachineBasicBlock::iterator BBI = MBB.begin(), BBE = MBB.end();
563 // Is there a critical edge from PreMBB to MBB?
569 if (PreMBB == &MBB && !SplitAllCriticalEdges)
586 << PreMBB->getNumber() << " -> BB#" << MBB.getNumber()
590 // If Reg is not live-in to MBB, it means it must be live-in to some
594 // If Reg *is* live-in to MBB, the interference is inevitable and a copy
598 ShouldSplit = ShouldSplit && !isLiveIn(Reg, &MBB);
615 if (!PreMBB->SplitCriticalEdge(&MBB, this)) {
626 bool PHIElimination::isLiveIn(unsigned Reg, const MachineBasicBlock *MBB) {
630 return LIS->isLiveInToMBB(LIS->getInterval(Reg), MBB);
632 return LV->isLiveIn(Reg, *MBB);
636 const MachineBasicBlock *MBB) {
646 for (const MachineBasicBlock *SI : MBB->successors())
651 return LV->isLiveOut(Reg, *MBB);