Lines Matching refs:Pred

476   bool isBestSuccessor(MachineBasicBlock *BB, MachineBasicBlock *Pred,
1162 for (MachineBasicBlock *Pred : Succ->predecessors()) { in canTailDuplicateUnplacedPreds()
1166 if (Pred == BB || (BlockFilter && !BlockFilter->count(Pred)) in canTailDuplicateUnplacedPreds()
1167 || (BlockToChain[Pred] == &Chain && !Succ->succ_empty())) in canTailDuplicateUnplacedPreds()
1169 if (!TailDup.canTailDuplicate(Succ, Pred)) { in canTailDuplicateUnplacedPreds()
1170 if (Successors.size() > 1 && hasSameSuccessors(*Pred, Successors)) in canTailDuplicateUnplacedPreds()
1323 for (MachineBasicBlock* Pred : PDom->predecessors()) { in precomputeTriangleChains()
1324 if (Pred == &BB) in precomputeTriangleChains()
1326 if (!TailDup.canTailDuplicate(PDom, Pred)) { in precomputeTriangleChains()
1545 for (MachineBasicBlock *Pred : Succ->predecessors()) { in hasBetterLayoutPredecessor()
1546 BlockChain *PredChain = BlockToChain[Pred]; in hasBetterLayoutPredecessor()
1547 if (Pred == Succ || PredChain == &SuccChain || in hasBetterLayoutPredecessor()
1548 (BlockFilter && !BlockFilter->count(Pred)) || in hasBetterLayoutPredecessor()
1549 PredChain == &Chain || Pred != *std::prev(PredChain->end()) || in hasBetterLayoutPredecessor()
1553 (Pred == BB)) in hasBetterLayoutPredecessor()
1569 MBFI->getBlockFreq(Pred) * MBPI->getEdgeProbability(Pred, Succ); in hasBetterLayoutPredecessor()
1832 for (MachineBasicBlock *Pred : ChainBB->predecessors()) { in fillWorkLists()
1833 if (BlockFilter && !BlockFilter->count(Pred)) in fillWorkLists()
1835 if (BlockToChain[Pred] == &Chain) in fillWorkLists()
1949 MachineBasicBlock *Pred = *BottomBlock->pred_begin(); in canMoveBottomBlockToTop() local
1950 if (Pred->succ_size() != 2) in canMoveBottomBlockToTop()
1953 MachineBasicBlock *OtherBB = *Pred->succ_begin(); in canMoveBottomBlockToTop()
1955 OtherBB = *Pred->succ_rbegin(); in canMoveBottomBlockToTop()
1968 for (MachineBasicBlock *Pred : Top->predecessors()) { in TopFallThroughFreq()
1969 BlockChain *PredChain = BlockToChain[Pred]; in TopFallThroughFreq()
1970 if (!LoopBlockSet.count(Pred) && in TopFallThroughFreq()
1971 (!PredChain || Pred == *std::prev(PredChain->end()))) { in TopFallThroughFreq()
1974 auto TopProb = MBPI->getEdgeProbability(Pred, Top); in TopFallThroughFreq()
1976 for (MachineBasicBlock *Succ : Pred->successors()) { in TopFallThroughFreq()
1977 auto SuccProb = MBPI->getEdgeProbability(Pred, Succ); in TopFallThroughFreq()
1988 BlockFrequency EdgeFreq = MBFI->getBlockFreq(Pred) * in TopFallThroughFreq()
1989 MBPI->getEdgeProbability(Pred, Top); in TopFallThroughFreq()
2036 for (MachineBasicBlock *Pred : NewTop->predecessors()) { in FallThroughGains()
2037 if (!LoopBlockSet.count(Pred)) in FallThroughGains()
2039 BlockChain *PredChain = BlockToChain[Pred]; in FallThroughGains()
2040 if (!PredChain || Pred == *std::prev(PredChain->end())) { in FallThroughGains()
2042 MBFI->getBlockFreq(Pred) * MBPI->getEdgeProbability(Pred, NewTop); in FallThroughGains()
2045 BestPred = Pred; in FallThroughGains()
2129 for (MachineBasicBlock *Pred : OldTop->predecessors()) { in findBestLoopTopHelper()
2130 if (!LoopBlockSet.count(Pred)) in findBestLoopTopHelper()
2132 if (Pred == L.getHeader()) in findBestLoopTopHelper()
2134 LLVM_DEBUG(dbgs() << " old top pred: " << getBlockName(Pred) << ", has " in findBestLoopTopHelper()
2135 << Pred->succ_size() << " successors, " in findBestLoopTopHelper()
2136 << printBlockFreq(MBFI->getMBFI(), *Pred) << " freq\n"); in findBestLoopTopHelper()
2137 if (Pred->succ_size() > 2) in findBestLoopTopHelper()
2141 if (Pred->succ_size() == 2) { in findBestLoopTopHelper()
2142 OtherBB = *Pred->succ_begin(); in findBestLoopTopHelper()
2144 OtherBB = *Pred->succ_rbegin(); in findBestLoopTopHelper()
2147 if (!canMoveBottomBlockToTop(Pred, OldTop)) in findBestLoopTopHelper()
2150 BlockFrequency Gains = FallThroughGains(Pred, OldTop, OtherBB, in findBestLoopTopHelper()
2154 ((Gains == BestGains) && Pred->isLayoutSuccessor(OldTop)))) { in findBestLoopTopHelper()
2155 BestPred = Pred; in findBestLoopTopHelper()
2337 for (MachineBasicBlock *Pred : Top->predecessors()) { in hasViableTopFallthrough()
2338 BlockChain *PredChain = BlockToChain[Pred]; in hasViableTopFallthrough()
2339 if (!LoopBlockSet.count(Pred) && in hasViableTopFallthrough()
2340 (!PredChain || Pred == *std::prev(PredChain->end()))) { in hasViableTopFallthrough()
2343 auto TopProb = MBPI->getEdgeProbability(Pred, Top); in hasViableTopFallthrough()
2345 for (MachineBasicBlock *Succ : Pred->successors()) { in hasViableTopFallthrough()
2346 auto SuccProb = MBPI->getEdgeProbability(Pred, Succ); in hasViableTopFallthrough()
2483 for (auto *Pred : ChainHeaderBB->predecessors()) { in rotateLoopWithProfile() local
2484 BlockChain *PredChain = BlockToChain[Pred]; in rotateLoopWithProfile()
2485 if (!LoopBlockSet.count(Pred) && in rotateLoopWithProfile()
2486 (!PredChain || Pred == *std::prev(PredChain->end()))) { in rotateLoopWithProfile()
2487 auto EdgeFreq = MBFI->getBlockFreq(Pred) * in rotateLoopWithProfile()
2488 MBPI->getEdgeProbability(Pred, ChainHeaderBB); in rotateLoopWithProfile()
2492 if (Pred->succ_size() == 1) in rotateLoopWithProfile()
3206 for (MachineBasicBlock *Pred : DuplicatedPreds) { in maybeTailDuplicateBlock()
3208 BlockChain* PredChain = BlockToChain[Pred]; in maybeTailDuplicateBlock()
3209 if (Pred == LPred) in maybeTailDuplicateBlock()
3211 if (Pred == LPred || (BlockFilter && !BlockFilter->count(Pred)) in maybeTailDuplicateBlock()
3214 for (MachineBasicBlock *NewSucc : Pred->successors()) { in maybeTailDuplicateBlock()
3244 MachineBasicBlock *Pred, in isBestSuccessor() argument
3246 if (BB == Pred) in isBestSuccessor()
3248 if (BlockFilter && !BlockFilter->count(Pred)) in isBestSuccessor()
3250 BlockChain *PredChain = BlockToChain[Pred]; in isBestSuccessor()
3251 if (PredChain && (Pred != *std::prev(PredChain->end()))) in isBestSuccessor()
3256 for (MachineBasicBlock *Succ : Pred->successors()) in isBestSuccessor()
3263 BranchProbability SuccProb = MBPI->getEdgeProbability(Pred, Succ); in isBestSuccessor()
3268 BranchProbability BBProb = MBPI->getEdgeProbability(Pred, BB); in isBestSuccessor()
3274 BlockFrequency PredFreq = getBlockCountOrFrequency(Pred); in isBestSuccessor()
3347 for (MachineBasicBlock *Pred : Preds) { in findDuplicateCandidates()
3348 BlockFrequency PredFreq = getBlockCountOrFrequency(Pred); in findDuplicateCandidates()
3350 if (!TailDup.canTailDuplicate(BB, Pred)) { in findDuplicateCandidates()
3353 if (!Fallthrough && isBestSuccessor(BB, Pred, BlockFilter)) { in findDuplicateCandidates()
3354 Fallthrough = Pred; in findDuplicateCandidates()
3376 Candidates.push_back(Pred); in findDuplicateCandidates()