Lines Matching defs:CurMBB
396 MachineBasicBlock *BranchFolder::SplitMBBAt(MachineBasicBlock &CurMBB,
399 if (!TII->isLegalToSplitMBBAt(CurMBB, BBI1))
402 MachineFunction &MF = *CurMBB.getParent();
405 MachineFunction::iterator MBBI = CurMBB.getIterator();
407 CurMBB.getParent()->insert(++MBBI, NewMBB);
410 NewMBB->transferSuccessors(&CurMBB);
412 // Add an edge from CurMBB to NewMBB for the fall-through.
413 CurMBB.addSuccessor(NewMBB);
416 NewMBB->splice(NewMBB->end(), &CurMBB, BBI1, CurMBB.end());
418 // NewMBB belongs to the same loop as CurMBB.
420 if (MachineLoop *ML = MLI->getLoopFor(&CurMBB))
423 // NewMBB inherits CurMBB's block frequency.
424 MBBFreqInfo.setBlockFreq(NewMBB, MBBFreqInfo.getBlockFreq(&CurMBB));
430 const auto &EHScopeI = EHScopeMembership.find(&CurMBB);
457 // CurMBB needs to add an unconditional branch to SuccMBB (we removed these
458 // branches temporarily for tail merging). In the case where CurMBB ends
461 static void FixTail(MachineBasicBlock *CurMBB, MachineBasicBlock *SuccBB,
463 MachineFunction *MF = CurMBB->getParent();
464 MachineFunction::iterator I = std::next(MachineFunction::iterator(CurMBB));
467 DebugLoc dl = CurMBB->findBranchDebugLoc();
470 if (I != MF->end() && !TII->analyzeBranch(*CurMBB, TBB, FBB, Cond, true)) {
474 TII->removeBranch(*CurMBB);
475 TII->insertBranch(*CurMBB, SuccBB, nullptr, Cond, dl);
480 TII->insertBranch(*CurMBB, SuccBB, nullptr,
702 MachineBasicBlock *CurMBB = CurMPIter->getBlock();
703 if (SuccBB && CurMBB != PredBB)
704 FixTail(CurMBB, SuccBB, TII, BranchDL);