Lines Matching refs:TailBB
91 void ProcessPHI(MachineInstr *MI, MachineBasicBlock *TailBB,
98 MachineBasicBlock *TailBB,
108 bool IsSimple, MachineBasicBlock &TailBB);
109 bool isSimpleBB(MachineBasicBlock *TailBB);
111 bool duplicateSimpleBB(MachineBasicBlock *TailBB,
115 bool TailDuplicate(MachineBasicBlock *TailBB,
397 MachineInstr *MI, MachineBasicBlock *TailBB, MachineBasicBlock *PredBB, in ProcessPHI() argument
412 if (isDefLiveOut(DefReg, TailBB, MRI) || RegsUsedByPhi.count(DefReg)) in ProcessPHI()
428 MachineBasicBlock *TailBB, in DuplicateInstruction() argument
446 if (isDefLiveOut(Reg, TailBB, MRI) || UsedByPhi.count(Reg)) in DuplicateInstruction()
549 MachineBasicBlock &TailBB) { in shouldTailDuplicate() argument
551 if (TailBB.canFallThrough()) in shouldTailDuplicate()
555 if (TailBB.isSuccessor(&TailBB)) in shouldTailDuplicate()
575 if (!TailBB.empty()) in shouldTailDuplicate()
576 HasIndirectbr = TailBB.back().isIndirectBranch(); in shouldTailDuplicate()
584 for (MachineBasicBlock::iterator I = TailBB.begin(); I != TailBB.end(); ++I) { in shouldTailDuplicate()
617 return canCompletelyDuplicateBB(TailBB); in shouldTailDuplicate()
622 TailDuplicatePass::isSimpleBB(MachineBasicBlock *TailBB) { in isSimpleBB() argument
623 if (TailBB->succ_size() != 1) in isSimpleBB()
625 if (TailBB->pred_empty()) in isSimpleBB()
627 MachineBasicBlock::iterator I = TailBB->begin(); in isSimpleBB()
628 MachineBasicBlock::iterator E = TailBB->end(); in isSimpleBB()
670 TailDuplicatePass::duplicateSimpleBB(MachineBasicBlock *TailBB, in duplicateSimpleBB() argument
674 SmallPtrSet<MachineBasicBlock*, 8> Succs(TailBB->succ_begin(), in duplicateSimpleBB()
675 TailBB->succ_end()); in duplicateSimpleBB()
676 SmallVector<MachineBasicBlock*, 8> Preds(TailBB->pred_begin(), in duplicateSimpleBB()
677 TailBB->pred_end()); in duplicateSimpleBB()
696 << "From simple Succ: " << *TailBB); in duplicateSimpleBB()
698 MachineBasicBlock *NewTarget = *TailBB->succ_begin(); in duplicateSimpleBB()
712 if (PredFBB == TailBB) in duplicateSimpleBB()
714 if (PredTBB == TailBB) in duplicateSimpleBB()
734 uint32_t Weight = MBPI->getEdgeWeight(PredBB, TailBB); in duplicateSimpleBB()
735 PredBB->removeSuccessor(TailBB); in duplicateSimpleBB()
749 TailDuplicatePass::TailDuplicate(MachineBasicBlock *TailBB, in TailDuplicate() argument
754 DEBUG(dbgs() << "\n*** Tail-duplicating BB#" << TailBB->getNumber() << '\n'); in TailDuplicate()
757 getRegsUsedByPHIs(*TailBB, &UsedByPhi); in TailDuplicate()
760 return duplicateSimpleBB(TailBB, TDBBs, UsedByPhi, Copies); in TailDuplicate()
766 SmallSetVector<MachineBasicBlock*, 8> Preds(TailBB->pred_begin(), in TailDuplicate()
767 TailBB->pred_end()); in TailDuplicate()
772 assert(TailBB != PredBB && in TailDuplicate()
785 if (PredBB->isLayoutSuccessor(TailBB) && PredBB->canFallThrough()) in TailDuplicate()
789 << "From Succ: " << *TailBB); in TailDuplicate()
796 if (RS && !TailBB->livein_empty()) { in TailDuplicate()
801 for (MachineBasicBlock::livein_iterator I = TailBB->livein_begin(), in TailDuplicate()
802 E = TailBB->livein_end(); I != E; ++I) { in TailDuplicate()
816 MachineBasicBlock::instr_iterator I = TailBB->instr_begin(); in TailDuplicate()
817 while (I != TailBB->instr_end()) { in TailDuplicate()
823 ProcessPHI(MI, TailBB, PredBB, LocalVRMap, CopyInfos, UsedByPhi, true); in TailDuplicate()
827 DuplicateInstruction(MI, TailBB, PredBB, MF, LocalVRMap, UsedByPhi); in TailDuplicate()
840 NumInstrDups += TailBB->size() - 1; // subtract one for removed branch in TailDuplicate()
846 for (MachineBasicBlock::succ_iterator I = TailBB->succ_begin(), in TailDuplicate()
847 E = TailBB->succ_end(); I != E; ++I) in TailDuplicate()
848 PredBB->addSuccessor(*I, MBPI->getEdgeWeight(TailBB, I)); in TailDuplicate()
857 MachineBasicBlock *PrevBB = std::prev(MachineFunction::iterator(TailBB)); in TailDuplicate()
864 PriorCond.empty() && !PriorTBB && TailBB->pred_size() == 1 && in TailDuplicate()
865 !TailBB->hasAddressTaken()) { in TailDuplicate()
867 << "From MBB: " << *TailBB); in TailDuplicate()
871 MachineBasicBlock::iterator I = TailBB->begin(); in TailDuplicate()
873 while (I != TailBB->end() && I->isPHI()) { in TailDuplicate()
877 ProcessPHI(MI, TailBB, PrevBB, LocalVRMap, CopyInfos, UsedByPhi, true); in TailDuplicate()
883 while (I != TailBB->end()) { in TailDuplicate()
888 DuplicateInstruction(MI, TailBB, PrevBB, MF, LocalVRMap, UsedByPhi); in TailDuplicate()
900 PrevBB->splice(PrevBB->end(), TailBB, TailBB->begin(), TailBB->end()); in TailDuplicate()
904 PrevBB->transferSuccessors(TailBB); in TailDuplicate()
944 MachineBasicBlock::iterator I = TailBB->begin(); in TailDuplicate()
946 while (I != TailBB->end() && I->isPHI()) { in TailDuplicate()
950 ProcessPHI(MI, TailBB, PredBB, LocalVRMap, CopyInfos, UsedByPhi, false); in TailDuplicate()