Home | History | Annotate | Download | only in AArch64

Lines Matching defs:MBB

92   void adjustBlockOffsets(MachineBasicBlock &MBB);
95 void computeBlockSize(const MachineBasicBlock &MBB);
122 for (MachineBasicBlock &MBB : *MF) {
123 unsigned Align = MBB.getAlignment();
124 unsigned Num = MBB.getNumber();
134 for (auto &MBB : *MF) {
135 const BasicBlockInfo &BBI = BlockInfo[MBB.getNumber()];
136 dbgs() << format("BB#%u\toffset=%08x\t", MBB.getNumber(), BBI.Offset)
143 static bool BBHasFallthrough(MachineBasicBlock *MBB) {
145 MachineFunction::iterator MBBI(MBB);
148 if (NextBB == MBB->getParent()->end())
151 for (MachineBasicBlock *S : MBB->successors())
168 for (MachineBasicBlock &MBB : *MF)
169 computeBlockSize(MBB);
175 /// computeBlockSize - Compute the size for MBB.
177 void AArch64BranchRelaxation::computeBlockSize(const MachineBasicBlock &MBB) {
179 for (const MachineInstr &MI : MBB)
181 BlockInfo[MBB.getNumber()].Size = Size;
188 MachineBasicBlock *MBB = MI->getParent();
190 // The offset is composed of two things: the sum of the sizes of all MBB's
193 unsigned Offset = BlockInfo[MBB->getNumber()].Offset;
195 // Sum instructions before MI in MBB.
196 for (MachineBasicBlock::iterator I = MBB->begin(); &*I != MI; ++I) {
197 assert(I != MBB->end() && "Didn't find MI in its own basic block?");
205 for (auto &MBB : make_range(MachineFunction::iterator(Start), MF->end())) {
206 unsigned Num = MBB.getNumber();
211 unsigned LogAlign = MBB.getAlignment();
227 // Create a new MBB for the code after the OrigBB.
375 // If the branch is at the end of its MBB and that has a fall-through block,
377 // split the MBB before the next instruction.
378 MachineBasicBlock *MBB = MI->getParent();
379 MachineInstr *BMI = &MBB->back();
380 bool NeedSplit = (BMI != MI) || !BBHasFallthrough(MBB);
384 std::prev(MBB->getLastNonDebugInstr()) &&
418 TII->analyzeBranch(*MBB, TBB, FBB, Cond, false);
423 int delta = TII->GetInstSizeInBytes(MBB->back());
424 BlockInfo[MBB->getNumber()].Size -= delta;
425 MBB->back().eraseFromParent();
430 MBB->replaceSuccessor(FBB, NewBB);
433 MachineBasicBlock *NextBB = &*std::next(MachineFunction::iterator(MBB));
441 MBB, DebugLoc(), TII->get(getOppositeConditionOpcode(MI->getOpcode())))
449 BlockInfo[MBB->getNumber()].Size += TII->GetInstSizeInBytes(MBB->back());
450 BuildMI(MBB
451 BlockInfo[MBB->getNumber()].Size += TII->GetInstSizeInBytes(MBB->back());
453 // Remove the old conditional branch. It may or may not still be in MBB.
458 adjustBlockOffsets(*MBB);
467 MachineBasicBlock &MBB = *I;
468 MachineInstr &MI = *MBB.getFirstTerminator();