Lines Matching defs:CmpBB
58 STATISTIC(NumCmpBranchRejs, "Number of ccmps rejected (CmpBB branch)");
59 STATISTIC(NumCmpTermRejs, "Number of ccmps rejected (CmpBB is cbz...)");
83 // / | CmpBB
85 // | CmpBB / |
92 // The Head block is terminated by a br.cond instruction, and the CmpBB block
95 // The cmp-conversion turns the compare instruction in CmpBB into a conditional
96 // compare, and merges CmpBB into Head, speculatively executing its
110 // CmpBB:
128 // branch to CmpBB.
149 MachineBasicBlock *CmpBB;
151 /// The common successor for Head and CmpBB.
154 /// The compare instruction in CmpBB that can be converted to a ccmp.
161 /// The condition code that makes Head branch to CmpBB.
164 /// The branch condition in CmpBB.
167 /// The condition code that makes CmpBB branch to Tail.
173 /// Remove CmpBB from the Tail PHIs.
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.
227 if (MBB == CmpBB) {
239 // removing the CmpBB operands. The Head operands will be identical.
244 // I is a PHI. It can have multiple entries for CmpBB.
247 if (I.getOperand(oi - 1).getMBB() == CmpBB) {
438 Tail = CmpBB = nullptr;
445 // CmpBB can only have a single predecessor. Tail is allowed many.
449 // Succ0 is our candidate for CmpBB.
453 CmpBB = Succ0;
456 if (!CmpBB->isSuccessor(Tail))
461 << printMBBReference(*CmpBB) << " -> "
467 // FIXME: Real PHIs could be if-converted as long as the CmpBB values are
468 // defined before The CmpBB cmp clobbers the flags. Alternatively, it should
469 // always be safe to sink the ccmp down to immediately before the CmpBB
483 // CmpBB should never have PHIs since Head is its only predecessor.
485 if (!CmpBB->empty() && CmpBB->front().isPHI()) {
486 LLVM_DEBUG(dbgs() << "Can't handle phis in CmpBB.\n");
491 if (!CmpBB->livein_empty()) {
492 LLVM_DEBUG(dbgs() << "Can't handle live-in physregs in CmpBB.\n");
522 if (TBB != CmpBB) {
529 if (TII->analyzeBranch(*CmpBB, TBB, FBB, CmpBBCond)) {
530 LLVM_DEBUG(dbgs() << "CmpBB branch not analyzable.\n");
537 dbgs() << "analyzeBranch didn't find conditional branch in CmpBB.\n");
543 LLVM_DEBUG(dbgs() << "Unsupported branch type on CmpBB\n");
551 LLVM_DEBUG(dbgs() << "Head->CmpBB on "
553 << ", CmpBB->Tail on "
556 CmpMI = findConvertibleCompare(CmpBB);
560 if (!canSpeculateInstrs(CmpBB, CmpMI)) {
568 LLVM_DEBUG(dbgs() << "Merging " << printMBBReference(*CmpBB) << " into "
570 << *CmpBB);
572 // All CmpBB instructions are moved into Head, and CmpBB is deleted.
576 // Save successor probabilties before removing CmpBB and Tail from their
578 BranchProbability Head2CmpBB = MBPI->getEdgeProbability(Head, CmpBB);
579 BranchProbability CmpBB2Tail = MBPI->getEdgeProbability(CmpBB, Tail);
581 Head->removeSuccessor(CmpBB);
582 CmpBB->removeSuccessor(Tail);
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
590 // Tail to account for the CmpBB path we removed.
592 // Pr(Tail|Head) += Pr(CmpBB|Head) * Pr(Tail|CmpBB).
598 // We will transfer successors of CmpBB to Head in a moment without
602 // Pr(I|Head) = Pr(CmpBB|Head) * Pr(I|CmpBB).
603 for (auto I = CmpBB->succ_begin(), E = CmpBB->succ_end(); I != E; ++I) {
604 BranchProbability CmpBB2I = MBPI->getEdgeProbability(CmpBB, *I);
605 CmpBB->setSuccProbability(I, Head2CmpBB * CmpBB2I);
609 Head->transferSuccessorsAndUpdatePHIs(CmpBB);
645 Head->splice(Head->end(), CmpBB, CmpBB->begin(), CmpBB->end());
682 // Head would have branched to CmpBB.
711 Head->updateTerminator(CmpBB->getNextNode());
713 RemovedBlocks.push_back(CmpBB);
820 // convert() removes CmpBB which was previously dominated by Head.
821 // CmpBB children should be transferred to Head.
826 assert(Node->getIDom() == HeadNode && "CmpBB should be dominated by Head");
845 Traces->invalidate(CmpConv.CmpBB);
858 // Head dominates CmpBB, so it is always included in its trace.
859 MachineTraceMetrics::Trace Trace = MinInstr->getTrace(CmpConv.CmpBB);
884 // Instruction depths can be computed for all trace instructions above CmpBB.
888 Trace.getInstrCycles(*CmpConv.CmpBB->getFirstTerminator()).Depth;
897 // Check the resource depth at the bottom of CmpBB - these instructions will