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);
163 MachineBasicBlock *MBB) { in explicitlyBranchesTo() argument
166 if (MO.isMBB() && MO.getMBB() == MBB) in explicitlyBranchesTo()
178 getEarliestInsertPos(MachineBasicBlock *MBB, const Container &BeforeSet, in getEarliestInsertPos() argument
180 auto InsertPos = MBB->end(); in getEarliestInsertPos()
181 while (InsertPos != MBB->begin()) { in getEarliestInsertPos()
185 for (auto Pos = InsertPos, E = MBB->begin(); Pos != E; --Pos) in getEarliestInsertPos()
202 getLatestInsertPos(MachineBasicBlock *MBB, const Container &BeforeSet, in getLatestInsertPos() argument
204 auto InsertPos = MBB->begin(); in getLatestInsertPos()
205 while (InsertPos != MBB->end()) { in getLatestInsertPos()
209 for (auto Pos = InsertPos, E = MBB->end(); Pos != E; ++Pos) in getLatestInsertPos()
251 void WebAssemblyCFGStackify::placeBlockMarker(MachineBasicBlock &MBB) { in placeBlockMarker() argument
252 assert(!MBB.isEHPad()); in placeBlockMarker()
253 MachineFunction &MF = *MBB.getParent(); in placeBlockMarker()
263 int MBBNumber = MBB.getNumber(); in placeBlockMarker()
264 for (MachineBasicBlock *Pred : MBB.predecessors()) { in placeBlockMarker()
267 if (explicitlyBranchesTo(Pred, &MBB)) in placeBlockMarker()
276 assert(&MBB != &MF.front() && "Header blocks shouldn't have predecessors"); in placeBlockMarker()
277 MachineBasicBlock *LayoutPred = MBB.getPrevNode(); in placeBlockMarker()
306 if (MBB.getNumber() > LoopBottom->getNumber()) in placeBlockMarker()
320 if (BeginToEnd[&MI]->getParent()->getNumber() <= MBB.getNumber()) in placeBlockMarker()
363 for (auto &MI : MBB) { in placeBlockMarker()
387 InsertPos = getEarliestInsertPos(&MBB, BeforeSet, AfterSet); in placeBlockMarker()
388 MachineInstr *End = BuildMI(MBB, InsertPos, MBB.findPrevDebugLoc(InsertPos), in placeBlockMarker()
393 updateScopeTops(Header, &MBB); in placeBlockMarker()
397 void WebAssemblyCFGStackify::placeLoopMarker(MachineBasicBlock &MBB) { in placeLoopMarker() argument
398 MachineFunction &MF = *MBB.getParent(); in placeLoopMarker()
404 MachineLoop *Loop = MLI.getLoopFor(&MBB); in placeLoopMarker()
405 if (!Loop || Loop->getHeader() != &MBB) in placeLoopMarker()
421 for (const auto &MI : MBB) { in placeLoopMarker()
433 auto InsertPos = getEarliestInsertPos(&MBB, BeforeSet, AfterSet); in placeLoopMarker()
434 MachineInstr *Begin = BuildMI(MBB, InsertPos, MBB.findDebugLoc(InsertPos), in placeLoopMarker()
442 for (const auto &MI : MBB) in placeLoopMarker()
459 ScopeTops[AfterLoop->getNumber()]->getNumber() < MBB.getNumber()) && in placeLoopMarker()
461 updateScopeTops(&MBB, AfterLoop); in placeLoopMarker()
464 void WebAssemblyCFGStackify::placeTryMarker(MachineBasicBlock &MBB) { in placeTryMarker() argument
465 assert(MBB.isEHPad()); in placeTryMarker()
466 MachineFunction &MF = *MBB.getParent(); in placeTryMarker()
476 int MBBNumber = MBB.getNumber(); in placeTryMarker()
477 for (auto *Pred : MBB.predecessors()) { in placeTryMarker()
480 assert(!explicitlyBranchesTo(Pred, &MBB) && in placeTryMarker()
489 WebAssemblyException *WE = WEI.getExceptionFor(&MBB); in placeTryMarker()
530 if (MBB.getNumber() > LoopBottom->getNumber()) in placeTryMarker()
563 if (MBB.isPredecessor(Header)) { in placeTryMarker()
647 registerTryScope(Begin, End, &MBB); in placeTryMarker()
660 for (auto *End : {&MBB, Cont}) in placeTryMarker()
700 for (auto &MBB : MF) { in removeUnnecessaryInstrs() local
701 if (!MBB.isEHPad()) in removeUnnecessaryInstrs()
706 MachineBasicBlock *EHPadLayoutPred = MBB.getPrevNode(); in removeUnnecessaryInstrs()
708 MachineBasicBlock *Cont = &MBB; in removeUnnecessaryInstrs()
754 for (auto &MBB : MF) { in removeUnnecessaryInstrs() local
755 for (auto &MI : MBB) { in removeUnnecessaryInstrs()
785 static void unstackifyVRegsUsedInSplitBB(MachineBasicBlock &MBB, in unstackifyVRegsUsedInSplitBB() argument
787 MachineFunction &MF = *MBB.getParent(); in unstackifyVRegsUsedInSplitBB()
797 if (Def->getParent() == &MBB) in unstackifyVRegsUsedInSplitBB()
825 for (MachineInstr &MI : llvm::make_early_inc_range(MBB)) { in unstackifyVRegsUsedInSplitBB()
836 BuildMI(MBB, &MI, MI.getDebugLoc(), TII.get(CopyOpc), TeeReg) in unstackifyVRegsUsedInSplitBB()
838 BuildMI(MBB, &MI, MI.getDebugLoc(), TII.get(CopyOpc), Reg).addReg(DefReg); in unstackifyVRegsUsedInSplitBB()
1097 for (auto &MBB : reverse(MF)) { in fixCallUnwindMismatches() local
1099 for (auto &MI : reverse(MBB)) { in fixCallUnwindMismatches()
1109 if (SeenThrowableInstInBB || !MBB.hasEHPadSuccessor() || in fixCallUnwindMismatches()
1117 for (auto *Succ : MBB.successors()) { in fixCallUnwindMismatches()
1133 if (RangeBegin->getIterator() != MBB.begin() && in fixCallUnwindMismatches()
1136 if (std::next(RangeEnd->getIterator()) != MBB.end() && in fixCallUnwindMismatches()
1143 LLVM_DEBUG(dbgs() << "- Call unwind mismatch: MBB = " << MBB.getName() in fixCallUnwindMismatches()
1173 for (auto &MBB : reverse(MF)) { in fixCallUnwindMismatches() local
1175 for (auto &MI : reverse(MBB)) { in fixCallUnwindMismatches()
1181 if (MBB.hasEHPadSuccessor() && MayThrow && !SeenThrowableInstInBB) in fixCallUnwindMismatches()
1230 auto *MBB = RangeBegin->getParent(); in fixCallUnwindMismatches() local
1238 for (auto *Succ : MBB->successors()) { in fixCallUnwindMismatches()
1245 MBB->removeSuccessor(EHPad); in fixCallUnwindMismatches()
1299 for (auto &MBB : reverse(MF)) { in fixCatchUnwindMismatches() local
1300 for (auto &MI : reverse(MBB)) { in fixCatchUnwindMismatches()
1304 EHPadStack.push_back(&MBB); in fixCatchUnwindMismatches()
1306 auto *EHPad = &MBB; in fixCatchUnwindMismatches()
1408 for (auto &MBB : MF) { in fixCatchUnwindMismatches() local
1409 for (auto &MI : MBB) { in fixCatchUnwindMismatches()
1443 for (auto &MBB : reverse(MF)) { in recalculateScopeTops() local
1444 for (auto &MI : reverse(MBB)) { in recalculateScopeTops()
1445 if (ScopeTops[MBB.getNumber()]) in recalculateScopeTops()
1452 updateScopeTops(EndToBegin[&MI]->getParent(), &MBB); in recalculateScopeTops()
1456 updateScopeTops(EHPadToTry[&MBB]->getParent(), &MBB); in recalculateScopeTops()
1488 auto *MBB = It->getParent(); in fixEndsAtEndOfFunction() local
1489 while (It != MBB->rend()) { in fixEndsAtEndOfFunction()
1518 Worklist.push_back(MBB->getPrevNode()->rbegin()); in fixEndsAtEndOfFunction()
1540 for (auto &MBB : MF) in placeMarkers() local
1541 placeLoopMarker(MBB); in placeMarkers()
1544 for (auto &MBB : MF) { in placeMarkers() local
1545 if (MBB.isEHPad()) { in placeMarkers()
1549 placeTryMarker(MBB); in placeMarkers()
1552 placeBlockMarker(MBB); in placeMarkers()
1566 const SmallVectorImpl<EndMarkerInfo> &Stack, const MachineBasicBlock *MBB) { in getBranchDepth() argument
1569 if (X.first == MBB) in getBranchDepth()
1578 const SmallVectorImpl<EndMarkerInfo> &Stack, const MachineBasicBlock *MBB) { in getDelegateDepth() argument
1579 if (MBB == FakeCallerBB) in getDelegateDepth()
1585 if (!MBB->isEHPad()) // Target is a delegate BB in getDelegateDepth()
1586 return getBranchDepth(Stack, MBB); in getDelegateDepth()
1602 const MachineInstr *EndTry = BeginToEnd[EHPadToTry[MBB]]; in getDelegateDepth()
1632 for (auto &MBB : reverse(MF)) { in rewriteDepthImmediates() local
1633 for (MachineInstr &MI : llvm::reverse(MBB)) { in rewriteDepthImmediates()
1638 MBB.getNumber() && in rewriteDepthImmediates()
1644 assert(Stack.back().first == &MBB && "Loop top should be balanced"); in rewriteDepthImmediates()
1650 Stack.push_back(std::make_pair(&MBB, &MI)); in rewriteDepthImmediates()
1680 Stack.push_back(std::make_pair(&MBB, &MI)); in rewriteDepthImmediates()