Lines Matching refs:Head
69 // Triangle: Head Diamond: Head
78 // Head block, and phis in the Tail block are converted to select instructions.
88 MachineBasicBlock *Head;
104 MachineBasicBlock *getTPred() const { return TBB == Tail ? Head : TBB; }
107 MachineBasicBlock *getFPred() const { return FBB == Tail ? Head : FBB; }
126 /// Instructions in Head that define values used by the conditional blocks.
136 /// Insertion point in Head for speculatively executed instructions form TBB
144 /// Find a valid insertion point in Head.
179 /// If instructions use any values that are defined in the head basic block,
228 // Check for any dependencies on Head instructions.
246 if (!DefMI || DefMI->getParent() != Head)
260 /// Find an insertion point in Head for the speculated instructions. The
275 MachineBasicBlock::iterator FirstTerm = Head->getFirstTerminator();
276 MachineBasicBlock::iterator I = Head->end();
277 MachineBasicBlock::iterator B = Head->begin();
341 Head = MBB;
344 if (Head->succ_size() != 2)
346 MachineBasicBlock *Succ0 = Head->succ_begin()[0];
347 MachineBasicBlock *Succ1 = Head->succ_begin()[1];
364 DEBUG(dbgs() << "\nDiamond: BB#" << Head->getNumber()
375 DEBUG(dbgs() << "\nTriangle: BB#" << Head->getNumber()
389 if (TII->AnalyzeBranch(*Head, TBB, FBB, Cond)) {
423 if (!TII->canInsertSelect(*Head, Cond, PI.TReg, PI.FReg,
439 // head basic block.
455 MachineBasicBlock::iterator FirstTerm = Head->getFirstTerminator();
456 assert(FirstTerm != Head->end() && "No terminators");
464 TII->insertSelect(*Head, FirstTerm, HeadDL, DstReg, Cond, PI.TReg, PI.FReg);
472 /// select instructions in Head and rewrite PHI operands to use the selects.
475 MachineBasicBlock::iterator FirstTerm = Head->getFirstTerminator();
476 assert(FirstTerm != Head->end() && "No terminators");
485 TII->insertSelect(*Head, FirstTerm, HeadDL, DstReg, Cond, PI.TReg, PI.FReg);
488 // Rewrite PHI operands TPred -> (DstReg, Head), remove FPred.
492 PI.PHI->getOperand(i-1).setMBB(Head);
509 assert(Head && Tail && TBB && FBB && "Call canConvertIf first.");
517 // Move all instructions into Head, except for the terminators.
519 Head->splice(InsertionPoint, TBB, TBB->begin(), TBB->getFirstTerminator());
521 Head->splice(InsertionPoint, FBB, FBB->begin(), FBB->getFirstTerminator());
530 // Fix up the CFG, temporarily leave Head without any successors.
531 Head->removeSuccessor(TBB);
532 Head->removeSuccessor(FBB);
538 // Fix up Head's terminators.
540 DebugLoc HeadDL = Head->getFirstTerminator()->getDebugLoc();
541 TII->RemoveBranch(*Head);
543 // Erase the now empty conditional blocks. It is likely that Head can fall
554 assert(Head->succ_empty() && "Additional head successors?");
555 if (!ExtraPreds && Head->isLayoutSuccessor(Tail)) {
556 // Splice Tail onto the end of Head.
558 << " into head BB#" << Head->getNumber() << '\n');
559 Head->splice(Head->end(), Tail,
561 Head->transferSuccessorsAndUpdatePHIs(Tail);
568 TII->InsertBranch(*Head, Tail, nullptr, EmptyCond, HeadDL);
569 Head->addSuccessor(Tail);
571 DEBUG(dbgs() << *Head);
631 // convertIf can remove TBB, FBB, and Tail can be merged into Head.
633 // Tail children should be transferred to Head.
634 MachineDomTreeNode *HeadNode = DomTree->getNode(IfConv.Head);
637 assert(Node != HeadNode && "Cannot erase the head node");
659 Traces->invalidate(IfConv.Head);
707 // Assume that the depth of the first head terminator will also be the depth
710 MachineTraceMetrics::Trace HeadTrace = MinInstr->getTrace(IfConv.Head);
712 HeadTrace.getInstrCycles(IfConv.Head->getFirstTerminator()).Depth;
800 // blocks, but only blocks dominated by the head block. This makes it safe to