Lines Matching refs:MachineBasicBlock
202 using BlockToChainMapType = DenseMap<const MachineBasicBlock *, BlockChain *>;
220 SmallVector<MachineBasicBlock *, 4> Blocks;
236 BlockChain(BlockToChainMapType &BlockToChain, MachineBasicBlock *BB) in BlockChain()
243 using iterator = SmallVectorImpl<MachineBasicBlock *>::iterator;
244 using const_iterator = SmallVectorImpl<MachineBasicBlock *>::const_iterator;
254 bool remove(MachineBasicBlock* BB) { in remove()
270 void merge(MachineBasicBlock *BB, BlockChain *Chain) { in merge()
288 for (MachineBasicBlock *ChainBB : *Chain) { in merge()
298 for (MachineBasicBlock *MBB : *this) in dump()
317 using BlockFilterSet = SmallSetVector<const MachineBasicBlock *, 16>;
321 MachineBasicBlock *BB;
328 MachineBasicBlock *Src;
329 MachineBasicBlock *Dest;
333 SmallVector<MachineBasicBlock *, 16> BlockWorkList;
334 SmallVector<MachineBasicBlock *, 16> EHPadWorkList;
337 DenseMap<const MachineBasicBlock *, BlockAndTailDupResult> ComputedEdges;
354 MachineBasicBlock *PreferredLoopExit;
387 DenseMap<const MachineBasicBlock *, BlockChain *> BlockToChain;
394 SmallPtrSet<MachineBasicBlock *, 4> BlocksWithUnanalyzableExits;
400 const BlockChain &Chain, const MachineBasicBlock *LoopHeaderBB,
406 const BlockChain &Chain, const MachineBasicBlock *BB,
407 const MachineBasicBlock *LoopHeaderBB,
412 const MachineBasicBlock *BB, const BlockChain &Chain,
414 SmallVector<MachineBasicBlock *, 4> &Successors);
416 const MachineBasicBlock *BB, const MachineBasicBlock *Succ,
420 MachineBasicBlock *BB, MachineBasicBlock *&LPred,
421 const MachineBasicBlock *LoopHeaderBB,
425 MachineBasicBlock *BB, MachineBasicBlock *LPred,
430 const MachineBasicBlock *BB, const MachineBasicBlock *Succ,
435 const MachineBasicBlock *BB, const BlockChain &Chain,
437 MachineBasicBlock *selectBestCandidateBlock(
438 const BlockChain &Chain, SmallVectorImpl<MachineBasicBlock *> &WorkList);
439 MachineBasicBlock *getFirstUnplacedBlock(
449 void fillWorkLists(const MachineBasicBlock *MBB,
453 void buildChain(const MachineBasicBlock *BB, BlockChain &Chain,
455 MachineBasicBlock *findBestLoopTop(
457 MachineBasicBlock *findBestLoopExit(
462 BlockChain &LoopChain, const MachineBasicBlock *ExitingBB,
472 bool shouldTailDuplicate(MachineBasicBlock *BB);
476 const MachineBasicBlock *BB, const MachineBasicBlock *Succ,
481 bool isTrellis(const MachineBasicBlock *BB,
482 const SmallVectorImpl<MachineBasicBlock *> &ViableSuccs,
487 const MachineBasicBlock *BB,
488 const SmallVectorImpl<MachineBasicBlock *> &ViableSuccs,
494 const MachineBasicBlock *BB,
500 const MachineBasicBlock *BB, MachineBasicBlock *Succ,
551 static std::string getBlockName(const MachineBasicBlock *BB) { in INITIALIZE_PASS_DEPENDENCY()
568 const BlockChain &Chain, const MachineBasicBlock *LoopHeaderBB, in markChainSuccessors()
572 for (MachineBasicBlock *MBB : Chain) { in markChainSuccessors()
584 const BlockChain &Chain, const MachineBasicBlock *MBB, in markBlockSuccessors()
585 const MachineBasicBlock *LoopHeaderBB, const BlockFilterSet *BlockFilter) { in markBlockSuccessors()
590 for (MachineBasicBlock *Succ : MBB->successors()) { in markBlockSuccessors()
617 const MachineBasicBlock *BB, const BlockChain &Chain, in collectViableSuccessors()
619 SmallVector<MachineBasicBlock *, 4> &Successors) { in collectViableSuccessors() argument
637 for (MachineBasicBlock *Succ : BB->successors()) { in collectViableSuccessors()
678 hasSameSuccessors(MachineBasicBlock &BB, in hasSameSuccessors()
679 SmallPtrSetImpl<const MachineBasicBlock *> &Successors) { in hasSameSuccessors()
685 for (MachineBasicBlock *Succ : BB.successors()) in hasSameSuccessors()
694 bool MachineBlockPlacement::shouldTailDuplicate(MachineBasicBlock *BB) { in shouldTailDuplicate()
724 const MachineBasicBlock *BB, const MachineBasicBlock *Succ, in isProfitableToTailDup()
750 MachineBasicBlock *PDom = nullptr; in isProfitableToTailDup()
751 SmallVector<MachineBasicBlock *, 4> SuccSuccs; in isProfitableToTailDup()
768 for (MachineBasicBlock *SuccSucc : SuccSuccs) { in isProfitableToTailDup()
781 for (MachineBasicBlock *SuccPred : Succ->predecessors()) { in isProfitableToTailDup()
878 const MachineBasicBlock *BB, in isTrellis()
879 const SmallVectorImpl<MachineBasicBlock *> &ViableSuccs, in isTrellis()
886 SmallPtrSet<const MachineBasicBlock *, 2> Successors(BB->succ_begin(), in isTrellis()
889 SmallPtrSet<const MachineBasicBlock *, 8> SeenPreds; in isTrellis()
891 for (MachineBasicBlock *Succ : ViableSuccs) { in isTrellis()
897 for (MachineBasicBlock *CheckSucc : SuccPred->successors()) in isTrellis()
929 const MachineBasicBlock *BB, in getBestNonConflictingEdges()
973 const MachineBasicBlock *BB, in getBestTrellisSuccessor()
974 const SmallVectorImpl<MachineBasicBlock *> &ViableSuccs, in getBestTrellisSuccessor()
979 SmallPtrSet<const MachineBasicBlock *, 4> Successors(BB->succ_begin(), in getBestTrellisSuccessor()
992 for (MachineBasicBlock *SuccPred : Succ->predecessors()) { in getBestTrellisSuccessor()
1024 MachineBasicBlock *Succ1 = BestA.Dest; in getBestTrellisSuccessor()
1025 MachineBasicBlock *Succ2 = BestB.Dest; in getBestTrellisSuccessor()
1058 const MachineBasicBlock *BB, MachineBasicBlock *Succ, in canTailDuplicateUnplacedPreds()
1064 SmallPtrSet<const MachineBasicBlock *, 4> Successors(BB->succ_begin(), in canTailDuplicateUnplacedPreds()
1066 for (MachineBasicBlock *Pred : Succ->predecessors()) { in canTailDuplicateUnplacedPreds()
1134 std::vector<MachineBasicBlock *> Edges; in precomputeTriangleChains()
1136 TriangleChain(MachineBasicBlock *src, MachineBasicBlock *dst) in precomputeTriangleChains()
1139 void append(MachineBasicBlock *dst) { in precomputeTriangleChains()
1147 MachineBasicBlock *getKey() const { in precomputeTriangleChains()
1158 DenseMap<const MachineBasicBlock *, TriangleChain> TriangleChainMap; in precomputeTriangleChains()
1159 for (MachineBasicBlock &BB : *F) { in precomputeTriangleChains()
1163 MachineBasicBlock *PDom = nullptr; in precomputeTriangleChains()
1164 for (MachineBasicBlock *Succ : BB.successors()) { in precomputeTriangleChains()
1184 for (MachineBasicBlock* Pred : PDom->predecessors()) { in precomputeTriangleChains()
1226 MachineBasicBlock *dst = Chain.Edges.back(); in precomputeTriangleChains()
1228 for (MachineBasicBlock *src : reverse(Chain.Edges)) { in precomputeTriangleChains()
1245 const MachineBasicBlock *BB) { in getLayoutSuccessorProbThreshold()
1249 const MachineBasicBlock *Succ1 = *BB->succ_begin(); in getLayoutSuccessorProbThreshold()
1250 const MachineBasicBlock *Succ2 = *(BB->succ_begin() + 1); in getLayoutSuccessorProbThreshold()
1277 const MachineBasicBlock *BB, const MachineBasicBlock *Succ, in hasBetterLayoutPredecessor()
1406 for (MachineBasicBlock *Pred : Succ->predecessors()) { in hasBetterLayoutPredecessor()
1457 const MachineBasicBlock *BB, const BlockChain &Chain, in selectBestSuccessor()
1464 SmallVector<MachineBasicBlock *, 4> Successors; in selectBestSuccessor()
1475 MachineBasicBlock *Succ = FoundEdge->second.BB; in selectBestSuccessor()
1492 SmallVector<std::tuple<BranchProbability, MachineBasicBlock *>, 4> in selectBestSuccessor()
1494 for (MachineBasicBlock *Succ : Successors) { in selectBestSuccessor()
1532 [](const std::tuple<BranchProbability, MachineBasicBlock *> &a, in selectBestSuccessor()
1533 const std::tuple<BranchProbability, MachineBasicBlock *> &b) { in selectBestSuccessor()
1540 MachineBasicBlock *Succ; in selectBestSuccessor()
1571 MachineBasicBlock *MachineBlockPlacement::selectBestCandidateBlock( in selectBestCandidateBlock()
1572 const BlockChain &Chain, SmallVectorImpl<MachineBasicBlock *> &WorkList) { in selectBestCandidateBlock()
1578 [&](MachineBasicBlock *BB) { in selectBestCandidateBlock()
1588 MachineBasicBlock *BestBlock = nullptr; in selectBestCandidateBlock()
1590 for (MachineBasicBlock *MBB : WorkList) { in selectBestCandidateBlock()
1640 MachineBasicBlock *MachineBlockPlacement::getFirstUnplacedBlock( in getFirstUnplacedBlock()
1660 const MachineBasicBlock *MBB, in fillWorkLists()
1670 for (MachineBasicBlock *ChainBB : Chain) { in fillWorkLists()
1673 for (MachineBasicBlock *Pred : ChainBB->predecessors()) { in fillWorkLists()
1685 MachineBasicBlock *BB = *Chain.begin(); in fillWorkLists()
1693 const MachineBasicBlock *HeadBB, BlockChain &Chain, in buildChain()
1699 const MachineBasicBlock *LoopHeaderBB = HeadBB; in buildChain()
1701 MachineBasicBlock *BB = *std::prev(Chain.end()); in buildChain()
1711 MachineBasicBlock* BestSucc = Result.BB; in buildChain()
1770 MachineBasicBlock *
1794 MachineBasicBlock *BestPred = nullptr; in findBestLoopTop()
1795 for (MachineBasicBlock *Pred : L.getHeader()->predecessors()) { in findBestLoopTop()
1834 MachineBasicBlock *
1851 MachineBasicBlock *ExitingBB = nullptr; in findBestLoopExit()
1855 SmallPtrSet<MachineBasicBlock *, 4> BlocksExitingToOuterLoop; in findBestLoopExit()
1859 for (MachineBasicBlock *MBB : L.getBlocks()) { in findBestLoopExit()
1870 MachineBasicBlock *OldExitingBB = ExitingBB; in findBestLoopExit()
1873 for (MachineBasicBlock *Succ : MBB->successors()) { in findBestLoopExit()
1957 const MachineBasicBlock *ExitingBB, in rotateLoop()
1962 MachineBasicBlock *Top = *LoopChain.begin(); in rotateLoop()
1963 MachineBasicBlock *Bottom = *std::prev(LoopChain.end()); in rotateLoop()
1970 for (MachineBasicBlock *Pred : Top->predecessors()) { in rotateLoop()
1983 for (MachineBasicBlock *Succ : Bottom->successors()) { in rotateLoop()
2017 MachineBasicBlock *NextBlockInChain = *std::next(ExitIt); in rotateLoop()
2084 SmallVector<std::pair<MachineBasicBlock *, BlockFrequency>, 4> ExitsWithFreq; in rotateLoopWithProfile()
2200 for (MachineBasicBlock *LoopBB : L.getBlocks()) { in collectLoopBlockSet()
2242 MachineBasicBlock *LoopTop = in buildLoopChains()
2265 for (const MachineBasicBlock *LoopBB : LoopBlockSet) in buildLoopChains()
2284 for (MachineBasicBlock *ChainBB : LoopChain) { in buildLoopChains()
2299 for (const MachineBasicBlock *LoopBB : LoopBlockSet) in buildLoopChains()
2318 MachineBasicBlock *BB = &*FI; in buildCFGChains()
2325 MachineBasicBlock *TBB = nullptr, *FBB = nullptr; // For AnalyzeBranch. in buildCFGChains()
2330 MachineBasicBlock *NextBB = &*NextFI; in buildCFGChains()
2357 for (MachineBasicBlock &MBB : *F) in buildCFGChains()
2364 using FunctionBlockSetType = SmallPtrSet<MachineBasicBlock *, 16>; in buildCFGChains()
2370 for (MachineBasicBlock &MBB : *F) in buildCFGChains()
2373 for (MachineBasicBlock *ChainBB : FunctionChain) in buildCFGChains()
2382 for (MachineBasicBlock *RemainingBB : FunctionBlockSet) in buildCFGChains()
2392 for (MachineBasicBlock *ChainBB : FunctionChain) { in buildCFGChains()
2404 MachineBasicBlock *PrevBB = &*std::prev(MachineFunction::iterator(ChainBB)); in buildCFGChains()
2410 MachineBasicBlock *TBB = nullptr, *FBB = nullptr; // For AnalyzeBranch. in buildCFGChains()
2452 MachineBasicBlock *TBB = nullptr, *FBB = nullptr; // For AnalyzeBranch. in buildCFGChains()
2470 for (MachineBasicBlock *ChainBB : FunctionChain) { in optimizeBranches()
2472 MachineBasicBlock *TBB = nullptr, *FBB = nullptr; // For AnalyzeBranch. in optimizeBranches()
2510 for (MachineBasicBlock *ChainBB : FunctionChain) { in alignBlocks()
2534 MachineBasicBlock *LoopHeader = L->getHeader(); in alignBlocks()
2541 MachineBasicBlock *LayoutPred = in alignBlocks()
2579 MachineBasicBlock *BB, MachineBasicBlock *&LPred, in repeatedlyTailDuplicateBlock()
2580 const MachineBasicBlock *LoopHeaderBB, in repeatedlyTailDuplicateBlock()
2599 MachineBasicBlock *DupBB, *DupPred; in repeatedlyTailDuplicateBlock()
2641 MachineBasicBlock *BB, MachineBasicBlock *LPred, in maybeTailDuplicateBlock()
2656 [&](MachineBasicBlock *RemBB) { in maybeTailDuplicateBlock()
2677 SmallVectorImpl<MachineBasicBlock *> &RemoveList = BlockWorkList; in maybeTailDuplicateBlock()
2682 [RemBB](MachineBasicBlock *BB) { in maybeTailDuplicateBlock()
2702 function_ref<void(MachineBasicBlock*)>(RemovalCallback); in maybeTailDuplicateBlock()
2704 SmallVector<MachineBasicBlock *, 8> DuplicatedPreds; in maybeTailDuplicateBlock()
2711 for (MachineBasicBlock *Pred : DuplicatedPreds) { in maybeTailDuplicateBlock()
2719 for (MachineBasicBlock *NewSucc : Pred->successors()) { in maybeTailDuplicateBlock()
2820 for (MachineBasicBlock &MBB : MF) in runOnMachineFunction()
2896 for (MachineBasicBlock &MBB : F) { in INITIALIZE_PASS_DEPENDENCY()
2902 for (MachineBasicBlock *Succ : MBB.successors()) { in INITIALIZE_PASS_DEPENDENCY()