Lines Matching refs:MBB
71 void placeBlockMarker(MachineBasicBlock &MBB);
72 void placeLoopMarker(MachineBasicBlock &MBB);
73 void placeTryMarker(MachineBasicBlock &MBB);
87 const MachineBasicBlock *MBB);
89 const MachineBasicBlock *MBB);
164 MachineBasicBlock *MBB) { in explicitlyBranchesTo() argument
167 if (MO.isMBB() && MO.getMBB() == MBB) in explicitlyBranchesTo()
179 getEarliestInsertPos(MachineBasicBlock *MBB, const Container &BeforeSet, in getEarliestInsertPos() argument
181 auto InsertPos = MBB->end(); in getEarliestInsertPos()
182 while (InsertPos != MBB->begin()) { in getEarliestInsertPos()
186 for (auto Pos = InsertPos, E = MBB->begin(); Pos != E; --Pos) in getEarliestInsertPos()
203 getLatestInsertPos(MachineBasicBlock *MBB, const Container &BeforeSet, in getLatestInsertPos() argument
205 auto InsertPos = MBB->begin(); in getLatestInsertPos()
206 while (InsertPos != MBB->end()) { in getLatestInsertPos()
210 for (auto Pos = InsertPos, E = MBB->end(); Pos != E; ++Pos) in getLatestInsertPos()
252 void WebAssemblyCFGStackify::placeBlockMarker(MachineBasicBlock &MBB) { in placeBlockMarker() argument
253 assert(!MBB.isEHPad()); in placeBlockMarker()
254 MachineFunction &MF = *MBB.getParent(); in placeBlockMarker()
264 int MBBNumber = MBB.getNumber(); in placeBlockMarker()
265 for (MachineBasicBlock *Pred : MBB.predecessors()) { in placeBlockMarker()
268 if (explicitlyBranchesTo(Pred, &MBB)) in placeBlockMarker()
277 assert(&MBB != &MF.front() && "Header blocks shouldn't have predecessors"); in placeBlockMarker()
278 MachineBasicBlock *LayoutPred = MBB.getPrevNode(); in placeBlockMarker()
307 if (MBB.getNumber() > LoopBottom->getNumber()) in placeBlockMarker()
321 if (BeginToEnd[&MI]->getParent()->getNumber() <= MBB.getNumber()) in placeBlockMarker()
364 for (auto &MI : MBB) { in placeBlockMarker()
388 InsertPos = getEarliestInsertPos(&MBB, BeforeSet, AfterSet); in placeBlockMarker()
389 MachineInstr *End = BuildMI(MBB, InsertPos, MBB.findPrevDebugLoc(InsertPos), in placeBlockMarker()
394 updateScopeTops(Header, &MBB); in placeBlockMarker()
398 void WebAssemblyCFGStackify::placeLoopMarker(MachineBasicBlock &MBB) { in placeLoopMarker() argument
399 MachineFunction &MF = *MBB.getParent(); in placeLoopMarker()
405 MachineLoop *Loop = MLI.getLoopFor(&MBB); in placeLoopMarker()
406 if (!Loop || Loop->getHeader() != &MBB) in placeLoopMarker()
422 for (const auto &MI : MBB) { in placeLoopMarker()
434 auto InsertPos = getEarliestInsertPos(&MBB, BeforeSet, AfterSet); in placeLoopMarker()
435 MachineInstr *Begin = BuildMI(MBB, InsertPos, MBB.findDebugLoc(InsertPos), in placeLoopMarker()
443 for (const auto &MI : MBB) in placeLoopMarker()
460 ScopeTops[AfterLoop->getNumber()]->getNumber() < MBB.getNumber()) && in placeLoopMarker()
462 updateScopeTops(&MBB, AfterLoop); in placeLoopMarker()
465 void WebAssemblyCFGStackify::placeTryMarker(MachineBasicBlock &MBB) { in placeTryMarker() argument
466 assert(MBB.isEHPad()); in placeTryMarker()
467 MachineFunction &MF = *MBB.getParent(); in placeTryMarker()
477 int MBBNumber = MBB.getNumber(); in placeTryMarker()
478 for (auto *Pred : MBB.predecessors()) { in placeTryMarker()
481 assert(!explicitlyBranchesTo(Pred, &MBB) && in placeTryMarker()
490 WebAssemblyException *WE = WEI.getExceptionFor(&MBB); in placeTryMarker()
531 if (MBB.getNumber() > LoopBottom->getNumber()) in placeTryMarker()
564 if (MBB.isPredecessor(Header)) { in placeTryMarker()
648 registerTryScope(Begin, End, &MBB); in placeTryMarker()
661 for (auto *End : {&MBB, Cont}) in placeTryMarker()
701 for (auto &MBB : MF) { in removeUnnecessaryInstrs() local
702 if (!MBB.isEHPad()) in removeUnnecessaryInstrs()
707 MachineBasicBlock *EHPadLayoutPred = MBB.getPrevNode(); in removeUnnecessaryInstrs()
709 MachineBasicBlock *Cont = &MBB; in removeUnnecessaryInstrs()
755 for (auto &MBB : MF) { in removeUnnecessaryInstrs() local
756 for (auto &MI : MBB) { in removeUnnecessaryInstrs()
786 static void unstackifyVRegsUsedInSplitBB(MachineBasicBlock &MBB, in unstackifyVRegsUsedInSplitBB() argument
788 MachineFunction &MF = *MBB.getParent(); in unstackifyVRegsUsedInSplitBB()
798 if (Def->getParent() == &MBB) in unstackifyVRegsUsedInSplitBB()
826 for (MachineInstr &MI : llvm::make_early_inc_range(MBB)) { in unstackifyVRegsUsedInSplitBB()
837 BuildMI(MBB, &MI, MI.getDebugLoc(), TII.get(CopyOpc), TeeReg) in unstackifyVRegsUsedInSplitBB()
839 BuildMI(MBB, &MI, MI.getDebugLoc(), TII.get(CopyOpc), Reg).addReg(DefReg); in unstackifyVRegsUsedInSplitBB()
1098 for (auto &MBB : reverse(MF)) { in fixCallUnwindMismatches() local
1100 for (auto &MI : reverse(MBB)) { in fixCallUnwindMismatches()
1110 if (SeenThrowableInstInBB || !MBB.hasEHPadSuccessor() || in fixCallUnwindMismatches()
1118 for (auto *Succ : MBB.successors()) { in fixCallUnwindMismatches()
1134 if (RangeBegin->getIterator() != MBB.begin() && in fixCallUnwindMismatches()
1137 if (std::next(RangeEnd->getIterator()) != MBB.end() && in fixCallUnwindMismatches()
1144 LLVM_DEBUG(dbgs() << "- Call unwind mismatch: MBB = " << MBB.getName() in fixCallUnwindMismatches()
1174 for (auto &MBB : reverse(MF)) { in fixCallUnwindMismatches() local
1176 for (auto &MI : reverse(MBB)) { in fixCallUnwindMismatches()
1182 if (MBB.hasEHPadSuccessor() && MayThrow && !SeenThrowableInstInBB) in fixCallUnwindMismatches()
1231 auto *MBB = RangeBegin->getParent(); in fixCallUnwindMismatches() local
1239 for (auto *Succ : MBB->successors()) { in fixCallUnwindMismatches()
1246 MBB->removeSuccessor(EHPad); in fixCallUnwindMismatches()
1300 for (auto &MBB : reverse(MF)) { in fixCatchUnwindMismatches() local
1301 for (auto &MI : reverse(MBB)) { in fixCatchUnwindMismatches()
1305 EHPadStack.push_back(&MBB); in fixCatchUnwindMismatches()
1307 auto *EHPad = &MBB; in fixCatchUnwindMismatches()
1409 for (auto &MBB : MF) { in fixCatchUnwindMismatches() local
1410 for (auto &MI : MBB) { in fixCatchUnwindMismatches()
1444 for (auto &MBB : reverse(MF)) { in recalculateScopeTops() local
1445 for (auto &MI : reverse(MBB)) { in recalculateScopeTops()
1446 if (ScopeTops[MBB.getNumber()]) in recalculateScopeTops()
1453 updateScopeTops(EndToBegin[&MI]->getParent(), &MBB); in recalculateScopeTops()
1457 updateScopeTops(EHPadToTry[&MBB]->getParent(), &MBB); in recalculateScopeTops()
1489 auto *MBB = It->getParent(); in fixEndsAtEndOfFunction() local
1490 while (It != MBB->rend()) { in fixEndsAtEndOfFunction()
1519 Worklist.push_back(MBB->getPrevNode()->rbegin()); in fixEndsAtEndOfFunction()
1541 for (auto &MBB : MF) in placeMarkers() local
1542 placeLoopMarker(MBB); in placeMarkers()
1545 for (auto &MBB : MF) { in placeMarkers() local
1546 if (MBB.isEHPad()) { in placeMarkers()
1550 placeTryMarker(MBB); in placeMarkers()
1553 placeBlockMarker(MBB); in placeMarkers()
1567 const SmallVectorImpl<EndMarkerInfo> &Stack, const MachineBasicBlock *MBB) { in getBranchDepth() argument
1570 if (X.first == MBB) in getBranchDepth()
1579 const SmallVectorImpl<EndMarkerInfo> &Stack, const MachineBasicBlock *MBB) { in getDelegateDepth() argument
1580 if (MBB == FakeCallerBB) in getDelegateDepth()
1586 if (!MBB->isEHPad()) // Target is a delegate BB in getDelegateDepth()
1587 return getBranchDepth(Stack, MBB); in getDelegateDepth()
1603 const MachineInstr *EndTry = BeginToEnd[EHPadToTry[MBB]]; in getDelegateDepth()
1655 for (auto &MBB : reverse(MF)) { in rewriteDepthImmediates() local
1656 for (MachineInstr &MI : llvm::reverse(MBB)) { in rewriteDepthImmediates()
1661 MBB.getNumber() && in rewriteDepthImmediates()
1667 assert(Stack.back().first == &MBB && "Loop top should be balanced"); in rewriteDepthImmediates()
1672 Stack.push_back(std::make_pair(&MBB, &MI)); in rewriteDepthImmediates()
1678 Stack.push_back(std::make_pair(&MBB, &MI)); in rewriteDepthImmediates()
1717 Stack.push_back(std::make_pair(&MBB, &MI)); in rewriteDepthImmediates()