Lines Matching refs:MBB
289 bool BBHasFallthrough(MachineBasicBlock *MBB);
328 void computeBlockSize(MachineBasicBlock *MBB);
350 MachineBasicBlock *MBB = &*MBBI;
351 unsigned MBBId = MBB->getNumber();
598 for (MachineBasicBlock &MBB : *MF) {
599 auto MI = MBB.getLastNonDebugInstr();
600 if (MI == MBB.end())
630 MF->insert(std::next(MachineFunction::iterator(MBB)), JumpTableBB);
640 LastCorrectlyNumberedBB = &MBB;
650 bool ARMConstantIslands::BBHasFallthrough(MachineBasicBlock *MBB) {
652 MachineFunction::iterator MBBI = MBB->getIterator();
654 if (std::next(MBBI) == MBB->getParent()->end())
658 if (std::find(MBB->succ_begin(), MBB->succ_end(), NextBB) == MBB->succ_end())
665 bool TooDifficult = TII->AnalyzeBranch(*MBB, TBB, FBB, Cond);
714 MachineBasicBlock &MBB = *MBBI;
716 for (MachineBasicBlock::iterator I = MBB.begin(), E = MBB.end();
735 for (MachineBasicBlock &MBB : *MF)
736 computeBlockSize(&MBB);
748 MachineBasicBlock &MBB = *MBBI;
750 // If this block doesn't fall through into the next MBB, then this is
752 if (!BBHasFallthrough(&MBB))
753 WaterList.push_back(&MBB);
755 for (MachineBasicBlock::iterator I = MBB.begin(), E = MBB.end();
899 /// computeBlockSize - Compute the size and some alignment information for MBB.
901 void ARMConstantIslands::computeBlockSize(MachineBasicBlock *MBB) {
902 BasicBlockInfo &BBI = BBInfo[MBB->getNumber()];
907 for (MachineBasicBlock::iterator I = MBB->begin(), E = MBB->end(); I != E;
920 if (!MBB->empty() && MBB->back().getOpcode() == ARM::tBR_JTr) {
922 MBB->getParent()->ensureAlignment(2);
930 MachineBasicBlock *MBB = MI->getParent();
932 // The offset is composed of two things: the sum of the sizes of all MBB's
935 unsigned Offset = BBInfo[MBB->getNumber()].Offset;
937 // Sum instructions before MI in MBB.
938 for (MachineBasicBlock::iterator I = MBB->begin(); &*I != MI; ++I) {
939 assert(I != MBB->end() && "Didn't find MI in its own basic block?");
945 /// CompareMBBNumbers - Little predicate function to sort the WaterList by MBB
956 // Renumber the MBB's to keep them consecutive.
978 // Create a new MBB for the code after the OrigBB.
1005 // Update internal data structures to account for the newly inserted MBB.
1160 static bool BBIsJumpedOver(MachineBasicBlock *MBB) {
1161 if (MBB->pred_size() != 1 || MBB->succ_size() != 1)
1164 MachineBasicBlock *Succ = *MBB->succ_begin();
1165 MachineBasicBlock *Pred = *MBB->pred_begin();
1568 // Update internal data structures to account for the newly inserted MBB.
1691 MachineBasicBlock *MBB = MI->getParent();
1698 BBInfo[MBB->getNumber()].Size += 2;
1699 adjustBBOffsetsAfter(MBB);
1727 // If the branch is at the end of its MBB and that has a fall-through block,
1729 // split the MBB before the next instruction.
1730 MachineBasicBlock *MBB = MI->getParent();
1731 MachineInstr *BMI = &MBB->back();
1732 bool NeedSplit = (BMI != MI) || !BBHasFallthrough(MBB);
1736 if (std::next(MachineBasicBlock::iterator(MI)) == std::prev(MBB->end()) &&
1761 int delta = TII->GetInstSizeInBytes(&MBB->back());
1762 BBInfo[MBB->getNumber()].Size -= delta;
1763 MBB->back().eraseFromParent();
1766 MachineBasicBlock *NextBB = &*++MBB->getIterator();
1774 BuildMI(MBB, DebugLoc(), TII->get(MI->getOpcode()))
1776 Br.MI = &MBB->back();
1777 BBInfo[MBB->getNumber()].Size += TII->GetInstSizeInBytes(&MBB->back());
1779 BuildMI(MBB, DebugLoc(), TII->get(Br.UncondBr)).addMBB(DestBB)
1782 BuildMI(MBB, DebugLoc(), TII->get(Br.UncondBr)).addMBB(DestBB);
1783 BBInfo[MBB->getNumber()].Size += TII->GetInstSizeInBytes(&MBB->back());
1785 ImmBranches.push_back(ImmBranch(&MBB->back(), MaxDisp, false, Br.UncondBr));
1787 // Remove the old conditional branch. It may or may not still be in MBB.
1790 adjustBBOffsetsAfter(MBB);
1877 MachineBasicBlock *MBB = U.MI->getParent();
1878 BBInfo[MBB->getNumber()].Size -= 2;
1879 adjustBBOffsetsAfter(MBB);
1924 MachineBasicBlock *MBB = Br.MI->getParent();
1925 BBInfo[MBB->getNumber()].Size -= 2;
1926 adjustBBOffsetsAfter(MBB);
1965 MachineBasicBlock *MBB = Br.MI->getParent();
1968 BuildMI(*MBB, CmpMI, Br.MI->getDebugLoc(), TII->get(NewOpc))
1973 BBInfo[MBB->getNumber()].Size -= 2;
1974 adjustBBOffsetsAfter(MBB);
2094 MachineFunction::iterator MBB = JTMI->getParent()->getIterator();
2095 MachineFunction *MF = MBB->getParent();
2096 ++MBB;
2098 return MBB != MF->end() && MBB->begin() != MBB->end() &&
2099 &*MBB->begin() == CPEMI;
2127 MachineBasicBlock *MBB = JTBBs[j];
2128 unsigned DstOffset = BBInfo[MBB->getNumber()].Offset;
2143 MachineBasicBlock *MBB = MI->getParent();
2164 BuildMI(*MBB, MI_JT, MI->getDebugLoc(), TII->get(Opc))
2170 DEBUG(dbgs() << "BB#" << MBB->getNumber() << ": " << *NewJTMI);
2208 BBInfo[MBB->getNumber()].Size -= Delta;
2209 adjustBBOffsetsAfter(MBB);
2242 MachineBasicBlock *MBB = JTBBs[j];
2243 int DTNumber = MBB->getNumber();
2249 adjustJTTargetBlockForward(MBB, MI->getParent());
2289 // Create a new MBB for the code after the jump BB.
2302 // Update internal data structures to account for the newly inserted MBB.