Lines Matching full:head
57 STATISTIC(NumHeadBranchRejs, "Number of ccmps rejected (Head branch)");
82 // From: Head To: Head
92 // The Head block is terminated by a br.cond instruction, and the CmpBB block
96 // compare, and merges CmpBB into Head, speculatively executing its
107 // Head:
119 // Head:
127 // The ccmp condition code is the one that would cause the Head terminator to
131 // between Head and Tail, just like if-converting a diamond.
146 MachineBasicBlock *Head;
148 /// The block containing cmp+br.cond with a successor shared with Head.
151 /// The common successor for Head and CmpBB.
158 /// The branch condition in Head as determined by analyzeBranch.
161 /// The condition code that makes Head branch to CmpBB.
212 // Check that all PHIs in Tail are selecting the same value from Head and CmpBB.
213 // This means that no if-conversion is required when merging CmpBB into Head.
223 if (MBB == Head) {
239 // removing the CmpBB operands. The Head operands will be identical.
437 Head = MBB;
440 if (Head->succ_size() != 2)
442 MachineBasicBlock *Succ0 = Head->succ_begin()[0];
443 MachineBasicBlock *Succ1 = Head->succ_begin()[1];
460 LLVM_DEBUG(dbgs() << "\nTriangle: " << printMBBReference(*Head) << " -> "
483 // CmpBB should never have PHIs since Head is its only predecessor.
500 if (TII->analyzeBranch(*Head, TBB, FBB, HeadCond)) {
501 LLVM_DEBUG(dbgs() << "Head branch not analyzable.\n");
510 dbgs() << "analyzeBranch didn't find conditional branch in Head.\n");
516 LLVM_DEBUG(dbgs() << "Unsupported branch type on Head\n");
551 LLVM_DEBUG(dbgs() << "Head->CmpBB on "
569 << printMBBReference(*Head) << ":\n"
572 // All CmpBB instructions are moved into Head, and CmpBB is deleted.
578 BranchProbability Head2CmpBB = MBPI->getEdgeProbability(Head, CmpBB);
581 Head->removeSuccessor(CmpBB);
584 // If Head and CmpBB had successor probabilties, udpate the probabilities to
586 if (Head->hasSuccessorProbabilities() && CmpBB->hasSuccessorProbabilities()) {
588 // Head is allowed two successors. We've removed CmpBB, so the remaining
592 // Pr(Tail|Head) += Pr(CmpBB|Head) * Pr(Tail|CmpBB).
593 assert(*Head->succ_begin() == Tail && "Head successor is not Tail");
594 BranchProbability Head2Tail = MBPI->getEdgeProbability(Head, Tail);
595 Head->setSuccProbability(Head->succ_begin(),
598 // We will transfer successors of CmpBB to Head in a moment without
602 // Pr(I|Head) = Pr(CmpBB|Head) * Pr(I|CmpBB).
609 Head->transferSuccessorsAndUpdatePHIs(CmpBB);
610 DebugLoc TermDL = Head->getFirstTerminator()->getDebugLoc();
611 TII->removeBranch(*Head);
613 // If the Head terminator was one of the cbz / tbz branches with built-in
628 llvm_unreachable("Cannot convert Head branch");
635 BuildMI(*Head, Head->end(), TermDL, MCID)
645 Head->splice(Head->end(), CmpBB, CmpBB->begin(), CmpBB->end());
682 // Head would have branched to CmpBB.
683 // The NZCV immediate operand should provide flags for the case where Head
684 // would have branched to Tail. These flags should cause the new Head
693 MachineInstrBuilder MIB = BuildMI(*Head, CmpMI, CmpMI->getDebugLoc(), MCID)
702 // This now becomes a Head terminator.
706 BuildMI(*Head, CmpMI, CmpMI->getDebugLoc(), TII->get(AArch64::Bcc))
711 Head->updateTerminator(CmpBB->getNextNode());
714 LLVM_DEBUG(dbgs() << "Result:\n" << *Head);
720 // If the Head terminator was one of the cbz / tbz branches with built-in
733 llvm_unreachable("Cannot convert Head branch");
738 // into Head, but we do not save any instruction.
820 // convert() removes CmpBB which was previously dominated by Head.
821 // CmpBB children should be transferred to Head.
822 MachineDomTreeNode *HeadNode = DomTree->getNode(CmpConv.Head);
825 assert(Node != HeadNode && "Cannot erase the head node");
826 assert(Node->getIDom() == HeadNode && "CmpBB should be dominated by Head");
844 Traces->invalidate(CmpConv.Head);
858 // Head dominates CmpBB, so it is always included in its trace.
886 Trace.getInstrCycles(*CmpConv.Head->getFirstTerminator()).Depth;
889 LLVM_DEBUG(dbgs() << "Head depth: " << HeadDepth
903 // merge into the Head block. The Head critical path should dominate the
948 // cmp-conversions from the same head block.