Home | History | Annotate | Download | only in Mips

Lines Matching refs:MBB

81     /// Set bits in Uses corresponding to MBB's live-out registers except for
83 void addLiveOut(const MachineBasicBlock &MBB,
198 bool runOnMachineBasicBlock(MachineBasicBlock &MBB);
200 Iter replaceWithCompactBranch(MachineBasicBlock &MBB,
203 Iter replaceWithCompactJump(MachineBasicBlock &MBB,
215 bool searchRange(MachineBasicBlock &MBB, IterTy Begin, IterTy End,
221 bool searchBackward(MachineBasicBlock &MBB, Iter Slot) const;
223 /// This function searches MBB in the forward direction for an instruction
225 bool searchForward(MachineBasicBlock &MBB, Iter Slot) const;
227 /// This function searches one of MBB's successor blocks for an instruction
230 bool searchSuccBBs(MachineBasicBlock &MBB, Iter Slot) const;
232 /// Pick a successor block of MBB. Return NULL if MBB doesn't have a
236 /// This function analyzes MBB and returns an instruction with an unoccupied
239 getBranch(MachineBasicBlock &MBB, const MachineBasicBlock &Dst) const;
274 /// This function adds registers Filler defines to MBB's live-in register list.
275 static void addLiveInRegs(Iter Filler, MachineBasicBlock &MBB) {
284 const MachineFunction &MF = *MBB.getParent();
290 if (!MBB.isLiveIn(R))
291 MBB.addLiveIn(R);
353 void RegDefsUses::addLiveOut(const MachineBasicBlock &MBB,
355 for (MachineBasicBlock::const_succ_iterator SI = MBB.succ_begin(),
356 SE = MBB.succ_end(); SI != SE; ++SI)
508 Iter Filler::replaceWithCompactBranch(MachineBasicBlock &MBB,
511 MBB.getParent()->getSubtarget<MipsSubtarget>().getInstrInfo();
518 MachineInstrBuilder MIB = BuildMI(MBB, Branch, DL, NewDesc);
525 MBB.erase(tmpIter);
531 Iter Filler::replaceWithCompactJump(MachineBasicBlock &MBB,
534 MBB.getParent()->getSubtarget<MipsSubtarget>().getInstrInfo();
537 MachineInstrBuilder MIB = BuildMI(MBB, Jump, DL, NewDesc);
543 MBB.erase(tmpIter);
569 bool Filler::runOnMachineBasicBlock(MachineBasicBlock &MBB) {
571 const MipsSubtarget &STI = MBB.getParent()->getSubtarget<MipsSubtarget>();
575 for (Iter I = MBB.begin(); I != MBB.end(); ++I) {
586 if (searchBackward(MBB, I)) {
589 if (searchSuccBBs(MBB, I)) {
592 } else if (searchForward(MBB, I)) {
620 I = replaceWithCompactBranch(MBB, I, I->getDebugLoc());
629 I = replaceWithCompactJump(MBB, I, I->getDebugLoc());
636 BuildMI(MBB, std::next(I), I->getDebugLoc(), TII->get(Mips::NOP));
637 MIBundleBuilder(MBB, I, std::next(I, 2));
650 bool Filler::searchRange(MachineBasicBlock &MBB, IterTy Begin, IterTy End,
683 const MipsSubtarget &STI = MBB.getParent()->getSubtarget<MipsSubtarget>();
711 bool Filler::searchBackward(MachineBasicBlock &MBB, Iter Slot) const {
715 auto *Fn = MBB.getParent();
722 if (!searchRange(MBB, ReverseIter(Slot), MBB.rend(), RegDU, MemDU, Slot,
726 MBB.splice(std::next(Slot), &MBB, std::next(Filler).base());
727 MIBundleBuilder(MBB, Slot, std::next(Slot, 2));
732 bool Filler::searchForward(MachineBasicBlock &MBB, Iter Slot) const {
737 RegDefsUses RegDU(*MBB.getParent()->getSubtarget().getRegisterInfo());
743 if (!searchRange(MBB, std::next(Slot), MBB.end(), RegDU, NM, Slot, Filler))
746 MBB.splice(std::next(Slot), &MBB, Filler);
747 MIBundleBuilder(MBB, Slot, std::next(Slot, 2));
752 bool Filler::searchSuccBBs(MachineBasicBlock &MBB, Iter Slot) const {
756 MachineBasicBlock *SuccBB = selectSuccBB(MBB);
761 RegDefsUses RegDU(*MBB.getParent()->getSubtarget().getRegisterInfo());
766 auto *Fn = MBB.getParent();
787 if (!searchRange(MBB, SuccBB->begin(), SuccBB->end(), RegDU, *IM, Slot,
814 Filler::getBranch(MachineBasicBlock &MBB, const MachineBasicBlock &Dst) const {
816 MBB.getParent()->getSubtarget<MipsSubtarget>().getInstrInfo();
822 TII->AnalyzeBranch(MBB, TrueBB, FalseBB, Cond, false, BranchInstrs);