Lines Matching refs:Chain

305   void merge(MachineBasicBlock *BB, BlockChain *Chain) {  in merge()  argument
310 if (!Chain) { in merge()
318 assert(BB == *Chain->begin() && "Passed BB is not head of Chain."); in merge()
319 assert(Chain->begin() != Chain->end()); in merge()
323 for (MachineBasicBlock *ChainBB : *Chain) { in merge()
325 assert(BlockToChain[ChainBB] == Chain && "Incoming blocks not in chain."); in merge()
461 const BlockChain &Chain, const MachineBasicBlock *LoopHeaderBB,
467 const BlockChain &Chain, const MachineBasicBlock *BB,
473 const MachineBasicBlock *BB, const BlockChain &Chain,
483 const MachineBasicBlock *LoopHeaderBB, BlockChain &Chain,
489 BlockChain &Chain, BlockFilterSet *BlockFilter,
496 BranchProbability RealSuccProb, const BlockChain &Chain,
499 const MachineBasicBlock *BB, const BlockChain &Chain,
502 const BlockChain &Chain, SmallVectorImpl<MachineBasicBlock *> &WorkList);
520 void buildChain(const MachineBasicBlock *BB, BlockChain &Chain,
558 const BlockChain &Chain, const BlockFilterSet *BlockFilter);
563 const BlockChain &Chain, const BlockFilterSet *BlockFilter);
569 BranchProbability AdjustedSumProb, const BlockChain &Chain,
581 const BlockChain &Chain, const BlockFilterSet *BlockFilter);
659 const BlockChain &Chain, const MachineBasicBlock *LoopHeaderBB, in markChainSuccessors() argument
663 for (MachineBasicBlock *MBB : Chain) { in markChainSuccessors()
664 markBlockSuccessors(Chain, MBB, LoopHeaderBB, BlockFilter); in markChainSuccessors()
675 const BlockChain &Chain, const MachineBasicBlock *MBB, in markBlockSuccessors() argument
686 if (&Chain == &SuccChain || Succ == LoopHeaderBB) in markBlockSuccessors()
708 const MachineBasicBlock *BB, const BlockChain &Chain, in collectViableSuccessors() argument
734 if (SuccChain == &Chain) { in collectViableSuccessors()
817 const BlockChain &Chain, const BlockFilterSet *BlockFilter) { in isProfitableToTailDup() argument
845 collectViableSuccessors(Succ, Chain, BlockFilter, SuccSuccs); in isProfitableToTailDup()
874 || BlockToChain[SuccPred] == &Chain in isProfitableToTailDup()
949 Chain, BlockFilter)) in isProfitableToTailDup()
971 const BlockChain &Chain, const BlockFilterSet *BlockFilter) { in isTrellis() argument
995 PredChain == &Chain || PredChain == BlockToChain[Succ]) in isTrellis()
1066 BranchProbability AdjustedSumProb, const BlockChain &Chain, in getBestTrellisSuccessor() argument
1087 BlockToChain[SuccPred] == &Chain || in getBestTrellisSuccessor()
1119 canTailDuplicateUnplacedPreds(BB, Succ2, Chain, BlockFilter) && in getBestTrellisSuccessor()
1121 Chain, BlockFilter)) { in getBestTrellisSuccessor()
1150 const BlockChain &Chain, const BlockFilterSet *BlockFilter) { in canTailDuplicateUnplacedPreds() argument
1167 || (BlockToChain[Pred] == &Chain && !Succ->succ_empty())) in canTailDuplicateUnplacedPreds()
1344 TriangleChain Chain = std::move(Found->second); in precomputeTriangleChains() local
1346 Chain.append(PDom); in precomputeTriangleChains()
1347 TriangleChainMap.insert(std::make_pair(Chain.getKey(), std::move(Chain))); in precomputeTriangleChains()
1359 TriangleChain &Chain = ChainPair.second; in precomputeTriangleChains() local
1363 if (Chain.count() < TriangleChainCount) in precomputeTriangleChains()
1365 MachineBasicBlock *dst = Chain.Edges.back(); in precomputeTriangleChains()
1366 Chain.Edges.pop_back(); in precomputeTriangleChains()
1367 for (MachineBasicBlock *src : reverse(Chain.Edges)) { in precomputeTriangleChains()
1418 BranchProbability RealSuccProb, const BlockChain &Chain, in hasBetterLayoutPredecessor() argument
1549 PredChain == &Chain || Pred != *std::prev(PredChain->end()) || in hasBetterLayoutPredecessor()
1597 const MachineBasicBlock *BB, const BlockChain &Chain, in selectBestSuccessor() argument
1606 collectViableSuccessors(BB, Chain, BlockFilter, Successors); in selectBestSuccessor()
1619 SuccChain != &Chain && Succ == *SuccChain->begin()) in selectBestSuccessor()
1625 if (isTrellis(BB, Successors, Chain, BlockFilter)) in selectBestSuccessor()
1626 return getBestTrellisSuccessor(BB, Successors, AdjustedSumProb, Chain, in selectBestSuccessor()
1643 Chain, BlockFilter)) { in selectBestSuccessor()
1681 if (canTailDuplicateUnplacedPreds(BB, Succ, Chain, BlockFilter) in selectBestSuccessor()
1682 && (isProfitableToTailDup(BB, Succ, BestProb, Chain, BlockFilter))) { in selectBestSuccessor()
1709 const BlockChain &Chain, SmallVectorImpl<MachineBasicBlock *> &WorkList) { in selectBestCandidateBlock() argument
1715 return BlockToChain.lookup(BB) == &Chain; in selectBestCandidateBlock()
1730 if (&SuccChain == &Chain) in selectBestCandidateBlock()
1822 BlockChain &Chain = *BlockToChain[MBB]; in fillWorkLists() local
1823 if (!UpdatedPreds.insert(&Chain).second) in fillWorkLists()
1827 Chain.UnscheduledPredecessors == 0 && in fillWorkLists()
1829 for (MachineBasicBlock *ChainBB : Chain) { in fillWorkLists()
1830 assert(BlockToChain[ChainBB] == &Chain && in fillWorkLists()
1835 if (BlockToChain[Pred] == &Chain) in fillWorkLists()
1837 ++Chain.UnscheduledPredecessors; in fillWorkLists()
1841 if (Chain.UnscheduledPredecessors != 0) in fillWorkLists()
1844 MachineBasicBlock *BB = *Chain.begin(); in fillWorkLists()
1852 const MachineBasicBlock *HeadBB, BlockChain &Chain, in buildChain() argument
1855 assert(BlockToChain[HeadBB] == &Chain && "BlockToChainMap mis-match.\n"); in buildChain()
1862 markChainSuccessors(Chain, LoopHeaderBB, BlockFilter); in buildChain()
1863 MachineBasicBlock *BB = *std::prev(Chain.end()); in buildChain()
1866 assert(BlockToChain[BB] == &Chain && "BlockToChainMap mis-match in loop."); in buildChain()
1867 assert(*std::prev(Chain.end()) == BB && "BB Not found at end of chain."); in buildChain()
1872 auto Result = selectBestSuccessor(BB, Chain, BlockFilter); in buildChain()
1877 Chain, in buildChain()
1884 BestSucc = selectBestCandidateBlock(Chain, BlockWorkList); in buildChain()
1886 BestSucc = selectBestCandidateBlock(Chain, EHPadWorkList); in buildChain()
1890 BestSucc = getFirstUnplacedBlock(Chain, PrevUnplacedBlockInFilterIt, in buildChain()
1893 BestSucc = getFirstUnplacedBlock(Chain, PrevUnplacedBlockIt); in buildChain()
1904 repeatedlyTailDuplicateBlock(BestSucc, BB, LoopHeaderBB, Chain, in buildChain()
1921 Chain.merge(BestSucc, &SuccChain); in buildChain()
1922 BB = *std::prev(Chain.end()); in buildChain()
1926 << getBlockName(*Chain.begin()) << "\n"); in buildChain()
2238 BlockChain &Chain = *BlockToChain[MBB]; in findBestLoopExit() local
2241 if (MBB != *std::prev(Chain.end())) in findBestLoopExit()
2258 if (&Chain == &SuccChain) { in findBestLoopExit()
2623 BlockChain *Chain = BlockToChain[LoopBB]; in collectLoopBlockSet() local
2624 for (MachineBasicBlock *ChainBB : *Chain) in collectLoopBlockSet()
2739 BlockChain *Chain = in buildCFGChains() local
2757 Chain->merge(NextBB, nullptr); in buildCFGChains()
3056 const MachineBasicBlock *LoopHeaderBB, BlockChain &Chain, in repeatedlyTailDuplicateBlock() argument
3062 BB, LPred, Chain, BlockFilter, PrevUnplacedBlockIt, in repeatedlyTailDuplicateBlock()
3078 BlockChain::iterator ChainEnd = Chain.end(); in repeatedlyTailDuplicateBlock()
3081 if (ChainEnd == Chain.begin()) in repeatedlyTailDuplicateBlock()
3085 DupBB, DupPred, Chain, BlockFilter, PrevUnplacedBlockIt, in repeatedlyTailDuplicateBlock()
3093 LPred = *std::prev(Chain.end()); in repeatedlyTailDuplicateBlock()
3095 markBlockSuccessors(Chain, LPred, LoopHeaderBB, BlockFilter); in repeatedlyTailDuplicateBlock()
3113 MachineBasicBlock *BB, MachineBasicBlock *LPred, BlockChain &Chain, in maybeTailDuplicateBlock() argument
3136 BlockChain *Chain = BlockToChain[RemBB]; in maybeTailDuplicateBlock() local
3137 InWorkList = Chain->UnscheduledPredecessors == 0; in maybeTailDuplicateBlock()
3138 Chain->remove(RemBB); in maybeTailDuplicateBlock()
3212 || PredChain == &Chain) in maybeTailDuplicateBlock()
3218 if (NewChain != &Chain && NewChain != PredChain) in maybeTailDuplicateBlock()