Lines Matching refs:TailBB
82 void ProcessPHI(MachineInstr *MI, MachineBasicBlock *TailBB,
89 MachineBasicBlock *TailBB,
99 bool IsSimple, MachineBasicBlock &TailBB);
100 bool isSimpleBB(MachineBasicBlock *TailBB);
102 bool duplicateSimpleBB(MachineBasicBlock *TailBB,
106 bool TailDuplicate(MachineBasicBlock *TailBB,
376 MachineBasicBlock *TailBB, in ProcessPHI() argument
393 if (isDefLiveOut(DefReg, TailBB, MRI) || RegsUsedByPhi.count(DefReg)) in ProcessPHI()
409 MachineBasicBlock *TailBB, in DuplicateInstruction() argument
427 if (isDefLiveOut(Reg, TailBB, MRI) || UsedByPhi.count(Reg)) in DuplicateInstruction()
529 MachineBasicBlock &TailBB) { in shouldTailDuplicate() argument
531 if (TailBB.canFallThrough()) in shouldTailDuplicate()
535 if (TailBB.isSuccessor(&TailBB)) in shouldTailDuplicate()
555 if (!TailBB.empty()) in shouldTailDuplicate()
556 HasIndirectbr = TailBB.back().getDesc().isIndirectBranch(); in shouldTailDuplicate()
564 for (MachineBasicBlock::const_iterator I = TailBB.begin(); I != TailBB.end(); in shouldTailDuplicate()
598 return canCompletelyDuplicateBB(TailBB); in shouldTailDuplicate()
603 TailDuplicatePass::isSimpleBB(MachineBasicBlock *TailBB) { in isSimpleBB() argument
604 if (TailBB->succ_size() != 1) in isSimpleBB()
606 if (TailBB->pred_empty()) in isSimpleBB()
608 MachineBasicBlock::iterator I = TailBB->begin(); in isSimpleBB()
609 MachineBasicBlock::iterator E = TailBB->end(); in isSimpleBB()
653 TailDuplicatePass::duplicateSimpleBB(MachineBasicBlock *TailBB, in duplicateSimpleBB() argument
657 SmallPtrSet<MachineBasicBlock*, 8> Succs(TailBB->succ_begin(), in duplicateSimpleBB()
658 TailBB->succ_end()); in duplicateSimpleBB()
659 SmallVector<MachineBasicBlock*, 8> Preds(TailBB->pred_begin(), in duplicateSimpleBB()
660 TailBB->pred_end()); in duplicateSimpleBB()
679 << "From simple Succ: " << *TailBB); in duplicateSimpleBB()
681 MachineBasicBlock *NewTarget = *TailBB->succ_begin(); in duplicateSimpleBB()
695 if (PredFBB == TailBB) in duplicateSimpleBB()
697 if (PredTBB == TailBB) in duplicateSimpleBB()
717 PredBB->removeSuccessor(TailBB); in duplicateSimpleBB()
731 TailDuplicatePass::TailDuplicate(MachineBasicBlock *TailBB, in TailDuplicate() argument
736 DEBUG(dbgs() << "\n*** Tail-duplicating BB#" << TailBB->getNumber() << '\n'); in TailDuplicate()
739 getRegsUsedByPHIs(*TailBB, &UsedByPhi); in TailDuplicate()
742 return duplicateSimpleBB(TailBB, TDBBs, UsedByPhi, Copies); in TailDuplicate()
748 SmallSetVector<MachineBasicBlock*, 8> Preds(TailBB->pred_begin(), in TailDuplicate()
749 TailBB->pred_end()); in TailDuplicate()
754 assert(TailBB != PredBB && in TailDuplicate()
767 if (PredBB->isLayoutSuccessor(TailBB) && PredBB->canFallThrough()) in TailDuplicate()
771 << "From Succ: " << *TailBB); in TailDuplicate()
781 MachineBasicBlock::iterator I = TailBB->begin(); in TailDuplicate()
782 while (I != TailBB->end()) { in TailDuplicate()
788 ProcessPHI(MI, TailBB, PredBB, LocalVRMap, CopyInfos, UsedByPhi, true); in TailDuplicate()
792 DuplicateInstruction(MI, TailBB, PredBB, MF, LocalVRMap, UsedByPhi); in TailDuplicate()
805 NumInstrDups += TailBB->size() - 1; // subtract one for removed branch in TailDuplicate()
811 for (MachineBasicBlock::succ_iterator I = TailBB->succ_begin(), in TailDuplicate()
812 E = TailBB->succ_end(); I != E; ++I) in TailDuplicate()
822 MachineBasicBlock *PrevBB = prior(MachineFunction::iterator(TailBB)); in TailDuplicate()
829 PriorCond.empty() && !PriorTBB && TailBB->pred_size() == 1 && in TailDuplicate()
830 !TailBB->hasAddressTaken()) { in TailDuplicate()
832 << "From MBB: " << *TailBB); in TailDuplicate()
836 MachineBasicBlock::iterator I = TailBB->begin(); in TailDuplicate()
838 while (I != TailBB->end() && I->isPHI()) { in TailDuplicate()
842 ProcessPHI(MI, TailBB, PrevBB, LocalVRMap, CopyInfos, UsedByPhi, true); in TailDuplicate()
848 while (I != TailBB->end()) { in TailDuplicate()
852 DuplicateInstruction(MI, TailBB, PrevBB, MF, LocalVRMap, UsedByPhi); in TailDuplicate()
864 PrevBB->splice(PrevBB->end(), TailBB, TailBB->begin(), TailBB->end()); in TailDuplicate()
868 PrevBB->transferSuccessors(TailBB); in TailDuplicate()
908 MachineBasicBlock::iterator I = TailBB->begin(); in TailDuplicate()
910 while (I != TailBB->end() && I->isPHI()) { in TailDuplicate()
914 ProcessPHI(MI, TailBB, PredBB, LocalVRMap, CopyInfos, UsedByPhi, false); in TailDuplicate()