Lines Matching refs:Pred
476 bool isBestSuccessor(MachineBasicBlock *BB, MachineBasicBlock *Pred,
1157 for (MachineBasicBlock *Pred : Succ->predecessors()) { in canTailDuplicateUnplacedPreds()
1161 if (Pred == BB || (BlockFilter && !BlockFilter->count(Pred)) in canTailDuplicateUnplacedPreds()
1162 || (BlockToChain[Pred] == &Chain && !Succ->succ_empty())) in canTailDuplicateUnplacedPreds()
1164 if (!TailDup.canTailDuplicate(Succ, Pred)) { in canTailDuplicateUnplacedPreds()
1165 if (Successors.size() > 1 && hasSameSuccessors(*Pred, Successors)) in canTailDuplicateUnplacedPreds()
1318 for (MachineBasicBlock* Pred : PDom->predecessors()) { in precomputeTriangleChains()
1319 if (Pred == &BB) in precomputeTriangleChains()
1321 if (!TailDup.canTailDuplicate(PDom, Pred)) { in precomputeTriangleChains()
1540 for (MachineBasicBlock *Pred : Succ->predecessors()) { in hasBetterLayoutPredecessor()
1541 BlockChain *PredChain = BlockToChain[Pred]; in hasBetterLayoutPredecessor()
1542 if (Pred == Succ || PredChain == &SuccChain || in hasBetterLayoutPredecessor()
1543 (BlockFilter && !BlockFilter->count(Pred)) || in hasBetterLayoutPredecessor()
1544 PredChain == &Chain || Pred != *std::prev(PredChain->end()) || in hasBetterLayoutPredecessor()
1548 (Pred == BB)) in hasBetterLayoutPredecessor()
1564 MBFI->getBlockFreq(Pred) * MBPI->getEdgeProbability(Pred, Succ); in hasBetterLayoutPredecessor()
1804 for (MachineBasicBlock *Pred : ChainBB->predecessors()) { in fillWorkLists()
1805 if (BlockFilter && !BlockFilter->count(Pred)) in fillWorkLists()
1807 if (BlockToChain[Pred] == &Chain) in fillWorkLists()
1913 MachineBasicBlock *Pred = *BottomBlock->pred_begin(); in canMoveBottomBlockToTop() local
1914 if (Pred->succ_size() != 2) in canMoveBottomBlockToTop()
1917 MachineBasicBlock *OtherBB = *Pred->succ_begin(); in canMoveBottomBlockToTop()
1919 OtherBB = *Pred->succ_rbegin(); in canMoveBottomBlockToTop()
1932 for (MachineBasicBlock *Pred : Top->predecessors()) { in TopFallThroughFreq()
1933 BlockChain *PredChain = BlockToChain[Pred]; in TopFallThroughFreq()
1934 if (!LoopBlockSet.count(Pred) && in TopFallThroughFreq()
1935 (!PredChain || Pred == *std::prev(PredChain->end()))) { in TopFallThroughFreq()
1938 auto TopProb = MBPI->getEdgeProbability(Pred, Top); in TopFallThroughFreq()
1940 for (MachineBasicBlock *Succ : Pred->successors()) { in TopFallThroughFreq()
1941 auto SuccProb = MBPI->getEdgeProbability(Pred, Succ); in TopFallThroughFreq()
1952 BlockFrequency EdgeFreq = MBFI->getBlockFreq(Pred) * in TopFallThroughFreq()
1953 MBPI->getEdgeProbability(Pred, Top); in TopFallThroughFreq()
2000 for (MachineBasicBlock *Pred : NewTop->predecessors()) { in FallThroughGains()
2001 if (!LoopBlockSet.count(Pred)) in FallThroughGains()
2003 BlockChain *PredChain = BlockToChain[Pred]; in FallThroughGains()
2004 if (!PredChain || Pred == *std::prev(PredChain->end())) { in FallThroughGains()
2006 MBFI->getBlockFreq(Pred) * MBPI->getEdgeProbability(Pred, NewTop); in FallThroughGains()
2009 BestPred = Pred; in FallThroughGains()
2093 for (MachineBasicBlock *Pred : OldTop->predecessors()) { in findBestLoopTopHelper()
2094 if (!LoopBlockSet.count(Pred)) in findBestLoopTopHelper()
2096 if (Pred == L.getHeader()) in findBestLoopTopHelper()
2098 LLVM_DEBUG(dbgs() << " old top pred: " << getBlockName(Pred) << ", has " in findBestLoopTopHelper()
2099 << Pred->succ_size() << " successors, " in findBestLoopTopHelper()
2100 << printBlockFreq(MBFI->getMBFI(), *Pred) << " freq\n"); in findBestLoopTopHelper()
2101 if (Pred->succ_size() > 2) in findBestLoopTopHelper()
2105 if (Pred->succ_size() == 2) { in findBestLoopTopHelper()
2106 OtherBB = *Pred->succ_begin(); in findBestLoopTopHelper()
2108 OtherBB = *Pred->succ_rbegin(); in findBestLoopTopHelper()
2111 if (!canMoveBottomBlockToTop(Pred, OldTop)) in findBestLoopTopHelper()
2114 BlockFrequency Gains = FallThroughGains(Pred, OldTop, OtherBB, in findBestLoopTopHelper()
2118 ((Gains == BestGains) && Pred->isLayoutSuccessor(OldTop)))) { in findBestLoopTopHelper()
2119 BestPred = Pred; in findBestLoopTopHelper()
2301 for (MachineBasicBlock *Pred : Top->predecessors()) { in hasViableTopFallthrough()
2302 BlockChain *PredChain = BlockToChain[Pred]; in hasViableTopFallthrough()
2303 if (!LoopBlockSet.count(Pred) && in hasViableTopFallthrough()
2304 (!PredChain || Pred == *std::prev(PredChain->end()))) { in hasViableTopFallthrough()
2307 auto TopProb = MBPI->getEdgeProbability(Pred, Top); in hasViableTopFallthrough()
2309 for (MachineBasicBlock *Succ : Pred->successors()) { in hasViableTopFallthrough()
2310 auto SuccProb = MBPI->getEdgeProbability(Pred, Succ); in hasViableTopFallthrough()
2447 for (auto *Pred : ChainHeaderBB->predecessors()) { in rotateLoopWithProfile() local
2448 BlockChain *PredChain = BlockToChain[Pred]; in rotateLoopWithProfile()
2449 if (!LoopBlockSet.count(Pred) && in rotateLoopWithProfile()
2450 (!PredChain || Pred == *std::prev(PredChain->end()))) { in rotateLoopWithProfile()
2451 auto EdgeFreq = MBFI->getBlockFreq(Pred) * in rotateLoopWithProfile()
2452 MBPI->getEdgeProbability(Pred, ChainHeaderBB); in rotateLoopWithProfile()
2456 if (Pred->succ_size() == 1) in rotateLoopWithProfile()
3152 for (MachineBasicBlock *Pred : DuplicatedPreds) { in maybeTailDuplicateBlock()
3154 BlockChain* PredChain = BlockToChain[Pred]; in maybeTailDuplicateBlock()
3155 if (Pred == LPred) in maybeTailDuplicateBlock()
3157 if (Pred == LPred || (BlockFilter && !BlockFilter->count(Pred)) in maybeTailDuplicateBlock()
3160 for (MachineBasicBlock *NewSucc : Pred->successors()) { in maybeTailDuplicateBlock()
3190 MachineBasicBlock *Pred, in isBestSuccessor() argument
3192 if (BB == Pred) in isBestSuccessor()
3194 if (BlockFilter && !BlockFilter->count(Pred)) in isBestSuccessor()
3196 BlockChain *PredChain = BlockToChain[Pred]; in isBestSuccessor()
3197 if (PredChain && (Pred != *std::prev(PredChain->end()))) in isBestSuccessor()
3202 for (MachineBasicBlock *Succ : Pred->successors()) in isBestSuccessor()
3209 BranchProbability SuccProb = MBPI->getEdgeProbability(Pred, Succ); in isBestSuccessor()
3214 BranchProbability BBProb = MBPI->getEdgeProbability(Pred, BB); in isBestSuccessor()
3220 BlockFrequency PredFreq = getBlockCountOrFrequency(Pred); in isBestSuccessor()
3293 for (MachineBasicBlock *Pred : Preds) { in findDuplicateCandidates()
3294 BlockFrequency PredFreq = getBlockCountOrFrequency(Pred); in findDuplicateCandidates()
3296 if (!TailDup.canTailDuplicate(BB, Pred)) { in findDuplicateCandidates()
3299 if (!Fallthrough && isBestSuccessor(BB, Pred, BlockFilter)) { in findDuplicateCandidates()
3300 Fallthrough = Pred; in findDuplicateCandidates()
3322 Candidates.push_back(Pred); in findDuplicateCandidates()