Lines Matching defs:Tail

75 //             Tail                       Tail
78 // Head block, and phis in the Tail block are converted to select instructions.
91 MachineBasicBlock *Tail;
100 /// equal to Tail.
101 bool isTriangle() const { return TBB == Tail || FBB == Tail; }
103 /// Returns the Tail predecessor for the True side.
104 MachineBasicBlock *getTPred() const { return TBB == Tail ? Head : TBB; }
106 /// Returns the Tail predecessor for the False side.
107 MachineBasicBlock *getFPred() const { return FBB == Tail ? Head : FBB; }
109 /// Information about each phi in the Tail block.
147 /// Replace PHI instructions in Tail with selects.
342 TBB = FBB = Tail = nullptr;
356 Tail = Succ0->succ_begin()[0];
359 if (Tail != Succ1) {
362 Succ1->succ_begin()[0] != Tail)
367 << " -> BB#" << Tail->getNumber() << '\n');
370 if (!Tail->livein_empty()) {
371 DEBUG(dbgs() << "Tail has live-ins.\n");
377 << " -> BB#" << Tail->getNumber() << '\n');
381 // If Tail doesn't have any phis, there must be side effects.
382 if (Tail->empty() || !Tail->front().isPHI()) {
408 for (MachineBasicBlock::iterator I = Tail->begin(), E = Tail->end();
433 if (TBB != Tail && !canSpeculateInstrs(TBB))
435 if (FBB != Tail && !canSpeculateInstrs(FBB))
451 /// This is possible when the only Tail predecessors are the if-converted
454 assert(Tail->pred_size() == 2 && "Cannot replace PHIs");
471 /// rewritePHIOperands - When there are additional Tail predecessors, insert
473 /// Keep the PHI instructions in Tail to handle the other predecessors.
509 assert(Head && Tail && TBB && FBB && "Call canConvertIf first.");
518 if (TBB != Tail)
520 if (FBB != Tail)
523 // Are there extra Tail predecessors?
524 bool ExtraPreds = Tail->pred_size() != 2;
533 if (TBB != Tail)
534 TBB->removeSuccessor(Tail);
535 if (FBB != Tail)
536 FBB->removeSuccessor(Tail);
544 // through to Tail, and we can join the two blocks.
545 if (TBB != Tail) {
549 if (FBB != Tail) {
555 if (!ExtraPreds && Head->isLayoutSuccessor(Tail)) {
556 // Splice Tail onto the end of Head.
557 DEBUG(dbgs() << "Joining tail BB#" << Tail->getNumber()
559 Head->splice(Head->end(), Tail,
560 Tail->begin(), Tail->end());
561 Head->transferSuccessorsAndUpdatePHIs(Tail);
562 RemovedBlocks.push_back(Tail);
563 Tail->eraseFromParent();
565 // We need a branch to Tail, let code placement work it out later.
568 TII->InsertBranch(*Head, Tail, nullptr, EmptyCond, HeadDL);
569 Head->addSuccessor(Tail);
631 // convertIf can remove TBB, FBB, and Tail can be merged into Head.
633 // Tail children should be transferred to Head.
639 assert(Node->getBlock() == IfConv.Tail && "Unexpected children");
660 Traces->invalidate(IfConv.Tail);
697 if (IfConv.TBB != IfConv.Tail)
717 MachineTraceMetrics::Trace TailTrace = MinInstr->getTrace(IfConv.Tail);