Home | History | Annotate | Download | only in CodeGen

Lines Matching full:mbb

100       // Is this MBB reachable from the MF entry point?
107 // Regs killed in MBB. They may be defined again, and will then be in both
111 // Regs defined in MBB and live out. Note that vregs passing through may
115 // Vregs that pass through MBB untouched. This set is disjoint from
119 // Vregs that must pass through MBB because they are needed by a successor
181 // Extra register info per MBB.
199 void visitMachineBasicBlockBefore(const MachineBasicBlock *MBB);
205 void visitMachineBasicBlockAfter(const MachineBasicBlock *MBB);
209 void report(const char *msg, const MachineBasicBlock *MBB);
214 void report(const char *msg, const MachineBasicBlock *MBB,
220 void markReachable(const MachineBasicBlock *MBB);
222 void checkPHIOps(const MachineBasicBlock *MBB);
384 void MachineVerifier::report(const char *msg, const MachineBasicBlock *MBB) {
385 assert(MBB);
386 report(msg, MBB->getParent());
387 *OS << "- basic block: BB#" << MBB->getNumber()
388 << ' ' << MBB->getName()
389 << " (" << (const void*)MBB << ')';
391 *OS << " [" << Indexes->getMBBStartIdx(MBB)
392 << ';' << Indexes->getMBBEndIdx(MBB) << ')';
425 void MachineVerifier::report(const char *msg, const MachineBasicBlock *MBB,
427 report(msg, MBB);
436 void MachineVerifier::markReachable(const MachineBasicBlock *MBB) {
437 BBInfo &MInfo = MBBInfoMap[MBB];
440 for (MachineBasicBlock::const_succ_iterator SuI = MBB->succ_begin(),
441 SuE = MBB->succ_end(); SuI != SuE; ++SuI)
471 report("MBB has duplicate entries in its predecessor list.", I);
475 report("MBB has duplicate entries in its successor list.", I);
495 MachineVerifier::visitMachineBasicBlockBefore(const MachineBasicBlock *MBB) {
501 for (MachineBasicBlock::livein_iterator LI = MBB->livein_begin(),
502 LE = MBB->livein_end();
505 if (isAllocatable(reg) && !MBB->isLandingPad() &&
506 MBB != MBB->getParent()->begin()) {
507 report("MBB has allocable live-in, but isn't entry or landing-pad.", MBB);
514 for (MachineBasicBlock::const_succ_iterator I = MBB->succ_begin(),
515 E = MBB->succ_end(); I != E; ++I) {
519 report("MBB has successor that isn't part of the function.", MBB);
520 if (!MBBInfoMap[*I].Preds.count(MBB)) {
521 report("Inconsistent CFG", MBB);
522 *OS << "MBB is not in the predecessor list of the successor BB#"
528 for (MachineBasicBlock::const_pred_iterator I = MBB->pred_begin(),
529 E = MBB->pred_end(); I != E; ++I) {
531 report("MBB has predecessor that isn't part of the function.", MBB);
532 if (!MBBInfoMap[*I].Succs.count(MBB)) {
533 report("Inconsistent CFG", MBB);
534 *OS << "MBB is not in the successor list of the predecessor BB#"
540 const BasicBlock *BB = MBB->getBasicBlock();
545 report("MBB has more than one landing pad successor", MBB);
550 if (!TII->AnalyzeBranch(*const_cast<MachineBasicBlock *>(MBB),
556 MachineFunction::const_iterator MBBI = MBB;
562 } else if (MBB->succ_size() == LandingPadSuccs.size()) {
566 } else if (MBB->succ_size() != 1+LandingPadSuccs.size()) {
567 report("MBB exits via unconditional fall-through but doesn't have "
568 "exactly one CFG successor!", MBB);
569 } else if (!MBB->isSuccessor(MBBI)) {
570 report("MBB exits via unconditional fall-through but its successor "
571 "differs from its CFG successor!", MBB);
573 if (!MBB->empty() && getBundleStart(&MBB->back())->isBarrier() &&
574 !TII->isPredicated(getBundleStart(&MBB->back()))) {
575 report("MBB exits via unconditional fall-through but ends with a "
576 "barrier instruction!", MBB);
579 report("MBB exits via unconditional fall-through but has a condition!",
580 MBB);
584 if (MBB->succ_size() != 1+LandingPadSuccs.size()) {
585 report("MBB exits via unconditional branch but doesn't have "
586 "exactly one CFG successor!", MBB);
587 } else if (!MBB->isSuccessor(TBB)) {
588 report("MBB exits via unconditional branch but the CFG "
589 "successor doesn't match the actual successor!", MBB);
591 if (MBB->empty()) {
592 report("MBB exits via unconditional branch but doesn't contain "
593 "any instructions!", MBB);
594 } else if (!getBundleStart(&MBB->back())->isBarrier()) {
595 report("MBB exits via unconditional branch but doesn't end with a "
596 "barrier instruction!", MBB);
597 } else if (!getBundleStart(&MBB->back())->isTerminator()) {
598 report("MBB exits via unconditional branch but the branch isn't a "
599 "terminator instruction!", MBB);
603 MachineFunction::const_iterator MBBI = MBB;
606 report("MBB conditionally falls through out of function!", MBB);
607 } else if (MBB->succ_size() == 1) {
610 report("MBB exits via conditional branch/fall-through but only has "
611 "one CFG successor!", MBB);
612 else if (TBB != *MBB->succ_begin())
613 report("MBB exits via conditional branch/fall-through but the CFG "
614 "successor don't match the actual successor!", MBB);
615 } else if (MBB->succ_size() != 2) {
616 report("MBB exits via conditional branch/fall-through but doesn't have "
617 "exactly two CFG successors!", MBB);
618 } else if (!matchPair(MBB->succ_begin(), TBB, MBBI)) {
619 report("MBB exits via conditional branch/fall-through but the CFG "
620 "successors don't match the actual successors!", MBB);
622 if (MBB->empty()) {
623 report("MBB exits via conditional branch/fall-through but doesn't "
624 "contain any instructions!", MBB);
625 } else if (getBundleStart(&MBB->back())->isBarrier()) {
626 report("MBB exits via conditional branch/fall-through but ends with a "
627 "barrier instruction!", MBB);
628 } else if (!getBundleStart(&MBB->back())->isTerminator()) {
629 report("MBB exits via conditional branch/fall-through but the branch "
630 "isn't a terminator instruction!", MBB);
635 if (MBB->succ_size() == 1) {
638 report("MBB exits via conditional branch/branch through but only has "
639 "one CFG successor!", MBB);
640 else if (TBB != *MBB->succ_begin())
641 report("MBB exits via conditional branch/branch through but the CFG "
642 "successor don't match the actual successor!", MBB);
643 } else if (MBB->succ_size() != 2) {
644 report("MBB exits via conditional branch/branch but doesn't have "
645 "exactly two CFG successors!", MBB);
646 } else if (!matchPair(MBB->succ_begin(), TBB, FBB)) {
647 report("MBB exits via conditional branch/branch but the CFG "
648 "successors don't match the actual successors!", MBB);
650 if (MBB->empty()) {
651 report("MBB exits via conditional branch/branch but doesn't "
652 "contain any instructions!", MBB);
653 } else if (!getBundleStart(&MBB->back())->isBarrier()) {
654 report("MBB exits via conditional branch/branch but doesn't end with a "
655 "barrier instruction!", MBB);
656 } else if (!getBundleStart(&MBB->back())->isTerminator()) {
657 report("MBB exits via conditional branch/branch but the branch "
658 "isn't a terminator instruction!", MBB);
661 report("MBB exits via conditinal branch/branch but there's no "
662 "condition!", MBB);
665 report("AnalyzeBranch returned invalid data!", MBB);
670 for (MachineBasicBlock::livein_iterator I = MBB->livein_begin(),
671 E = MBB->livein_end(); I != E; ++I) {
673 report("MBB live-in list contains non-physical register", MBB);
684 BitVector PR = MFI->getPristineRegs(MBB);
695 lastIndex = Indexes->getMBBStartIdx(MBB);
1051 // if vreg was killed in this MBB. Otherwise keep track of vregs that
1123 MachineVerifier::visitMachineBasicBlockAfter(const MachineBasicBlock *MBB) {
1124 MBBInfoMap[MBB].regsLiveOut = regsLive;
1128 SlotIndex stop = Indexes->getMBBEndIdx(MBB);
1130 report("Block ends before last instruction index", MBB);
1139 // can pass through an MBB live, but may not be live every time. It is assumed
1147 const MachineBasicBlock &MBB(*MFI);
1148 BBInfo &MInfo = MBBInfoMap[&MBB];
1151 for (MachineBasicBlock::const_succ_iterator SuI = MBB.succ_begin(),
1152 SuE = MBB.succ_end(); SuI != SuE; ++SuI) {
1162 const MachineBasicBlock *MBB = *todo.begin();
1163 todo.erase(MBB);
1164 BBInfo &MInfo = MBBInfoMap[MBB];
1165 for (MachineBasicBlock::const_succ_iterator SuI = MBB->succ_begin(),
1166 SuE = MBB->succ_end(); SuI != SuE; ++SuI) {
1167 if (*SuI == MBB)
1184 const MachineBasicBlock &MBB(*MFI);
1185 BBInfo &MInfo = MBBInfoMap[&MBB];
1186 for (MachineBasicBlock::const_pred_iterator PrI = MBB.pred_begin(),
1187 PrE = MBB.pred_end(); PrI != PrE; ++PrI) {
1197 const MachineBasicBlock *MBB = *todo.begin();
1198 todo.erase(MBB);
1199 BBInfo &MInfo = MBBInfoMap[MBB];
1200 for (MachineBasicBlock::const_pred_iterator PrI = MBB->pred_begin(),
1201 PrE = MBB->pred_end(); PrI != PrE; ++PrI) {
1202 if (*PrI == MBB)
1211 // Check PHI instructions at the beginning of MBB. It is assumed that
1213 void MachineVerifier::checkPHIOps(const MachineBasicBlock *MBB) {
1215 for (MachineBasicBlock::const_iterator BBI = MBB->begin(), BBE = MBB->end();
1222 if (!Pre->isSuccessor(MBB))
1232 for (MachineBasicBlock::const_pred_iterator PrI = MBB->pred_begin(),
1233 PrE = MBB->pred_end(); PrI != PrE; ++PrI) {
1362 const MachineBasicBlock *MBB = LiveInts->getMBBFromIndex(VNI->def);
1363 if (!MBB) {
1371 if (VNI->def != LiveInts->getMBBStartIdx(MBB)) {
1372 report("PHIDef value is not defined at MBB start", MBB, LI);
1374 << ", not at the beginning of BB#" << MBB->getNumber() << '\n';
1382 report("No instruction at def index", MBB, LI);
1414 report("Early clobber def must be at an early-clobber slot", MBB, LI);
1419 MBB, LI);
1440 const MachineBasicBlock *MBB = LiveInts->getMBBFromIndex(I->start);
1441 if (!MBB) {
1446 SlotIndex MBBStartIdx = LiveInts->getMBBStartIdx(MBB);
1448 report("Live segment must begin at MBB entry or valno def", MBB, LI);
1534 MachineFunction::const_iterator MFI = MBB;
1538 if (MBB == EndMBB)
1649 const MachineBasicBlock *MBB = *DFI;
1663 // Update stack state by checking contents of MBB.
1664 for (MachineBasicBlock::const_iterator I = MBB->begin(), E = MBB->end();
1697 SPState[MBB->getNumber()] = BBState;
1701 for (MachineBasicBlock::const_pred_iterator I = MBB->pred_begin(),
1702 E = MBB->pred_end(); I != E; ++I) {
1706 report("The exit stack state of a predecessor is inconsistent.", MBB);
1710 << "), while BB#" << MBB->getNumber() << " has entry state ("
1717 for (MachineBasicBlock::const_succ_iterator I = MBB->succ_begin(),
1718 E = MBB->succ_end(); I != E; ++I) {
1722 report("The entry stack state of a successor is inconsistent.", MBB);
1726 << "), while BB#" << MBB->getNumber() << " has exit state ("
1732 if (!MBB->empty() && MBB->back().isReturn()) {
1734 report("A return block ends with a FrameSetup.", MBB);
1736 report("A return block ends with a nonzero stack adjustment.", MBB);