Lines Matching defs:Tail

76 //             Tail                       Tail
79 // Head block, and phis in the Tail block are converted to select instructions.
92 MachineBasicBlock *Tail;
101 /// equal to Tail.
102 bool isTriangle() const { return TBB == Tail || FBB == Tail; }
104 /// Returns the Tail predecessor for the True side.
105 MachineBasicBlock *getTPred() const { return TBB == Tail ? Head : TBB; }
107 /// Returns the Tail predecessor for the False side.
108 MachineBasicBlock *getFPred() const { return FBB == Tail ? Head : FBB; }
110 /// Information about each phi in the Tail block.
159 /// Replace PHI instructions in Tail with selects.
440 TBB = FBB = Tail = nullptr;
454 Tail = Succ0->succ_begin()[0];
457 if (Tail != Succ1) {
460 Succ1->succ_begin()[0] != Tail)
465 << printMBBReference(*Tail) << '\n');
468 if (!Tail->livein_empty()) {
469 LLVM_DEBUG(dbgs() << "Tail has live-ins.\n");
475 << printMBBReference(*Tail) << '\n');
481 if (!Predicate && (Tail->empty() || !Tail->front().isPHI())) {
514 for (MachineBasicBlock::iterator I = Tail->begin(), E = Tail->end();
541 if (TBB != Tail && !canPredicateInstrs(TBB))
543 if (FBB != Tail && !canPredicateInstrs(FBB))
546 if (TBB != Tail && !canSpeculateInstrs(TBB))
548 if (FBB != Tail && !canSpeculateInstrs(FBB))
611 /// This is possible when the only Tail predecessors are the if-converted
614 assert(Tail->pred_size() == 2 && "Cannot replace PHIs");
638 /// rewritePHIOperands - When there are additional Tail predecessors, insert
640 /// Keep the PHI instructions in Tail to handle the other predecessors.
685 assert(Head && Tail && TBB && FBB && "Call canConvertIf first.");
694 if (TBB != Tail) {
699 if (FBB != Tail) {
704 // Are there extra Tail predecessors?
705 bool ExtraPreds = Tail->pred_size() != 2;
714 if (TBB != Tail)
715 TBB->removeSuccessor(Tail, true);
716 if (FBB != Tail)
717 FBB->removeSuccessor(Tail, true);
725 // through to Tail, and we can join the two blocks.
726 if (TBB != Tail) {
730 if (FBB != Tail) {
736 if (!ExtraPreds && Head->isLayoutSuccessor(Tail)) {
737 // Splice Tail onto the end of Head.
738 LLVM_DEBUG(dbgs() << "Joining tail " << printMBBReference(*Tail)
740 Head->splice(Head->end(), Tail,
741 Tail->begin(), Tail->end());
742 Head->transferSuccessorsAndUpdatePHIs(Tail);
743 RemovedBlocks.push_back(Tail);
744 Tail->eraseFromParent();
746 // We need a branch to Tail, let code placement work it out later.
749 TII->insertBranch(*Head, Tail, nullptr, EmptyCond, HeadDL);
750 Head->addSuccessor(Tail);
811 // convertIf can remove TBB, FBB, and Tail can be merged into Head.
813 // Tail children should be transferred to Head.
819 assert(Node->getBlock() == IfConv.Tail && "Unexpected children");
840 Traces->invalidate(IfConv.Tail);
923 if (IfConv.TBB != IfConv.Tail)
954 MachineTraceMetrics::Trace TailTrace = MinInstr->getTrace(IfConv.Tail);
1163 (IfConv.TBB == IfConv.Tail) ? *IfConv.FBB : *IfConv.TBB;