• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /freebsd-13-stable/contrib/llvm-project/llvm/lib/Target/AArch64/

Lines Matching refs:CmpBB

60 STATISTIC(NumCmpBranchRejs, "Number of ccmps rejected (CmpBB branch)");
61 STATISTIC(NumCmpTermRejs, "Number of ccmps rejected (CmpBB is cbz...)");
85 // / | CmpBB
87 // | CmpBB / |
94 // The Head block is terminated by a br.cond instruction, and the CmpBB block
97 // The cmp-conversion turns the compare instruction in CmpBB into a conditional
98 // compare, and merges CmpBB into Head, speculatively executing its
112 // CmpBB:
130 // branch to CmpBB.
151 MachineBasicBlock *CmpBB;
153 /// The common successor for Head and CmpBB.
156 /// The compare instruction in CmpBB that can be converted to a ccmp.
163 /// The condition code that makes Head branch to CmpBB.
166 /// The branch condition in CmpBB.
169 /// The condition code that makes CmpBB branch to Tail.
175 /// Remove CmpBB from the Tail PHIs.
214 // Check that all PHIs in Tail are selecting the same value from Head and CmpBB.
215 // This means that no if-conversion is required when merging CmpBB into Head.
229 if (MBB == CmpBB) {
241 // removing the CmpBB operands. The Head operands will be identical.
246 // I is a PHI. It can have multiple entries for CmpBB.
249 if (I.getOperand(oi - 1).getMBB() == CmpBB) {
440 Tail = CmpBB = nullptr;
447 // CmpBB can only have a single predecessor. Tail is allowed many.
451 // Succ0 is our candidate for CmpBB.
455 CmpBB = Succ0;
458 if (!CmpBB->isSuccessor(Tail))
463 << printMBBReference(*CmpBB) << " -> "
469 // FIXME: Real PHIs could be if-converted as long as the CmpBB values are
470 // defined before The CmpBB cmp clobbers the flags. Alternatively, it should
471 // always be safe to sink the ccmp down to immediately before the CmpBB
485 // CmpBB should never have PHIs since Head is its only predecessor.
487 if (!CmpBB->empty() && CmpBB->front().isPHI()) {
488 LLVM_DEBUG(dbgs() << "Can't handle phis in CmpBB.\n");
493 if (!CmpBB->livein_empty()) {
494 LLVM_DEBUG(dbgs() << "Can't handle live-in physregs in CmpBB.\n");
524 if (TBB != CmpBB) {
531 if (TII->analyzeBranch(*CmpBB, TBB, FBB, CmpBBCond)) {
532 LLVM_DEBUG(dbgs() << "CmpBB branch not analyzable.\n");
539 dbgs() << "analyzeBranch didn't find conditional branch in CmpBB.\n");
545 LLVM_DEBUG(dbgs() << "Unsupported branch type on CmpBB\n");
553 LLVM_DEBUG(dbgs() << "Head->CmpBB on "
555 << ", CmpBB->Tail on "
558 CmpMI = findConvertibleCompare(CmpBB);
562 if (!canSpeculateInstrs(CmpBB, CmpMI)) {
570 LLVM_DEBUG(dbgs() << "Merging " << printMBBReference(*CmpBB) << " into "
572 << *CmpBB);
574 // All CmpBB instructions are moved into Head, and CmpBB is deleted.
578 // Save successor probabilties before removing CmpBB and Tail from their
580 BranchProbability Head2CmpBB = MBPI->getEdgeProbability(Head, CmpBB);
581 BranchProbability CmpBB2Tail = MBPI->getEdgeProbability(CmpBB, Tail);
583 Head->removeSuccessor(CmpBB);
584 CmpBB->removeSuccessor(Tail);
586 // If Head and CmpBB had successor probabilties, udpate the probabilities to
588 if (Head->hasSuccessorProbabilities() && CmpBB->hasSuccessorProbabilities()) {
590 // Head is allowed two successors. We've removed CmpBB, so the remaining
592 // Tail to account for the CmpBB path we removed.
594 // Pr(Tail|Head) += Pr(CmpBB|Head) * Pr(Tail|CmpBB).
600 // We will transfer successors of CmpBB to Head in a moment without
604 // Pr(I|Head) = Pr(CmpBB|Head) * Pr(I|CmpBB).
605 for (auto I = CmpBB->succ_begin(), E = CmpBB->succ_end(); I != E; ++I) {
606 BranchProbability CmpBB2I = MBPI->getEdgeProbability(CmpBB, *I);
607 CmpBB->setSuccProbability(I, Head2CmpBB * CmpBB2I);
611 Head->transferSuccessorsAndUpdatePHIs(CmpBB);
647 Head->splice(Head->end(), CmpBB, CmpBB->begin(), CmpBB->end());
684 // Head would have branched to CmpBB.
713 Head->updateTerminator(CmpBB->getNextNode());
715 RemovedBlocks.push_back(CmpBB);
716 CmpBB->eraseFromParent();
823 // convert() removes CmpBB which was previously dominated by Head.
824 // CmpBB children should be transferred to Head.
829 assert(Node->getIDom() == HeadNode && "CmpBB should be dominated by Head");
848 Traces->invalidate(CmpConv.CmpBB);
861 // Head dominates CmpBB, so it is always included in its trace.
862 MachineTraceMetrics::Trace Trace = MinInstr->getTrace(CmpConv.CmpBB);
887 // Instruction depths can be computed for all trace instructions above CmpBB.
891 Trace.getInstrCycles(*CmpConv.CmpBB->getFirstTerminator()).Depth;
900 // Check the resource depth at the bottom of CmpBB - these instructions will