Lines Matching refs:Pred
454 bool isBestSuccessor(MachineBasicBlock *BB, MachineBasicBlock *Pred,
1126 for (MachineBasicBlock *Pred : Succ->predecessors()) { in canTailDuplicateUnplacedPreds()
1130 if (Pred == BB || (BlockFilter && !BlockFilter->count(Pred)) in canTailDuplicateUnplacedPreds()
1131 || BlockToChain[Pred] == &Chain) in canTailDuplicateUnplacedPreds()
1133 if (!TailDup.canTailDuplicate(Succ, Pred)) { in canTailDuplicateUnplacedPreds()
1134 if (Successors.size() > 1 && hasSameSuccessors(*Pred, Successors)) in canTailDuplicateUnplacedPreds()
1287 for (MachineBasicBlock* Pred : PDom->predecessors()) { in precomputeTriangleChains()
1288 if (Pred == &BB) in precomputeTriangleChains()
1290 if (!TailDup.canTailDuplicate(PDom, Pred)) { in precomputeTriangleChains()
1509 for (MachineBasicBlock *Pred : Succ->predecessors()) { in hasBetterLayoutPredecessor()
1510 BlockChain *PredChain = BlockToChain[Pred]; in hasBetterLayoutPredecessor()
1511 if (Pred == Succ || PredChain == &SuccChain || in hasBetterLayoutPredecessor()
1512 (BlockFilter && !BlockFilter->count(Pred)) || in hasBetterLayoutPredecessor()
1513 PredChain == &Chain || Pred != *std::prev(PredChain->end()) || in hasBetterLayoutPredecessor()
1517 (Pred == BB)) in hasBetterLayoutPredecessor()
1533 MBFI->getBlockFreq(Pred) * MBPI->getEdgeProbability(Pred, Succ); in hasBetterLayoutPredecessor()
1772 for (MachineBasicBlock *Pred : ChainBB->predecessors()) { in fillWorkLists()
1773 if (BlockFilter && !BlockFilter->count(Pred)) in fillWorkLists()
1775 if (BlockToChain[Pred] == &Chain) in fillWorkLists()
1881 MachineBasicBlock *Pred = *BottomBlock->pred_begin(); in canMoveBottomBlockToTop() local
1882 if (Pred->succ_size() != 2) in canMoveBottomBlockToTop()
1885 MachineBasicBlock *OtherBB = *Pred->succ_begin(); in canMoveBottomBlockToTop()
1887 OtherBB = *Pred->succ_rbegin(); in canMoveBottomBlockToTop()
1900 for (MachineBasicBlock *Pred : Top->predecessors()) { in TopFallThroughFreq()
1901 BlockChain *PredChain = BlockToChain[Pred]; in TopFallThroughFreq()
1902 if (!LoopBlockSet.count(Pred) && in TopFallThroughFreq()
1903 (!PredChain || Pred == *std::prev(PredChain->end()))) { in TopFallThroughFreq()
1906 auto TopProb = MBPI->getEdgeProbability(Pred, Top); in TopFallThroughFreq()
1908 for (MachineBasicBlock *Succ : Pred->successors()) { in TopFallThroughFreq()
1909 auto SuccProb = MBPI->getEdgeProbability(Pred, Succ); in TopFallThroughFreq()
1920 BlockFrequency EdgeFreq = MBFI->getBlockFreq(Pred) * in TopFallThroughFreq()
1921 MBPI->getEdgeProbability(Pred, Top); in TopFallThroughFreq()
1968 for (MachineBasicBlock *Pred : NewTop->predecessors()) { in FallThroughGains()
1969 if (!LoopBlockSet.count(Pred)) in FallThroughGains()
1971 BlockChain *PredChain = BlockToChain[Pred]; in FallThroughGains()
1972 if (!PredChain || Pred == *std::prev(PredChain->end())) { in FallThroughGains()
1973 BlockFrequency EdgeFreq = MBFI->getBlockFreq(Pred) * in FallThroughGains()
1974 MBPI->getEdgeProbability(Pred, NewTop); in FallThroughGains()
1977 BestPred = Pred; in FallThroughGains()
2059 for (MachineBasicBlock *Pred : OldTop->predecessors()) { in findBestLoopTopHelper()
2060 if (!LoopBlockSet.count(Pred)) in findBestLoopTopHelper()
2062 if (Pred == L.getHeader()) in findBestLoopTopHelper()
2064 LLVM_DEBUG(dbgs() << " old top pred: " << getBlockName(Pred) << ", has " in findBestLoopTopHelper()
2065 << Pred->succ_size() << " successors, "; in findBestLoopTopHelper()
2066 MBFI->printBlockFreq(dbgs(), Pred) << " freq\n"); in findBestLoopTopHelper()
2067 if (Pred->succ_size() > 2) in findBestLoopTopHelper()
2071 if (Pred->succ_size() == 2) { in findBestLoopTopHelper()
2072 OtherBB = *Pred->succ_begin(); in findBestLoopTopHelper()
2074 OtherBB = *Pred->succ_rbegin(); in findBestLoopTopHelper()
2077 if (!canMoveBottomBlockToTop(Pred, OldTop)) in findBestLoopTopHelper()
2080 BlockFrequency Gains = FallThroughGains(Pred, OldTop, OtherBB, in findBestLoopTopHelper()
2083 ((Gains == BestGains) && Pred->isLayoutSuccessor(OldTop)))) { in findBestLoopTopHelper()
2084 BestPred = Pred; in findBestLoopTopHelper()
2266 for (MachineBasicBlock *Pred : Top->predecessors()) { in hasViableTopFallthrough()
2267 BlockChain *PredChain = BlockToChain[Pred]; in hasViableTopFallthrough()
2268 if (!LoopBlockSet.count(Pred) && in hasViableTopFallthrough()
2269 (!PredChain || Pred == *std::prev(PredChain->end()))) { in hasViableTopFallthrough()
2272 auto TopProb = MBPI->getEdgeProbability(Pred, Top); in hasViableTopFallthrough()
2274 for (MachineBasicBlock *Succ : Pred->successors()) { in hasViableTopFallthrough()
2275 auto SuccProb = MBPI->getEdgeProbability(Pred, Succ); in hasViableTopFallthrough()
2412 for (auto *Pred : ChainHeaderBB->predecessors()) { in rotateLoopWithProfile() local
2413 BlockChain *PredChain = BlockToChain[Pred]; in rotateLoopWithProfile()
2414 if (!LoopBlockSet.count(Pred) && in rotateLoopWithProfile()
2415 (!PredChain || Pred == *std::prev(PredChain->end()))) { in rotateLoopWithProfile()
2416 auto EdgeFreq = MBFI->getBlockFreq(Pred) * in rotateLoopWithProfile()
2417 MBPI->getEdgeProbability(Pred, ChainHeaderBB); in rotateLoopWithProfile()
2421 if (Pred->succ_size() == 1) in rotateLoopWithProfile()
3083 for (MachineBasicBlock *Pred : DuplicatedPreds) { in maybeTailDuplicateBlock()
3085 BlockChain* PredChain = BlockToChain[Pred]; in maybeTailDuplicateBlock()
3086 if (Pred == LPred) in maybeTailDuplicateBlock()
3088 if (Pred == LPred || (BlockFilter && !BlockFilter->count(Pred)) in maybeTailDuplicateBlock()
3091 for (MachineBasicBlock *NewSucc : Pred->successors()) { in maybeTailDuplicateBlock()
3121 MachineBasicBlock *Pred, in isBestSuccessor() argument
3123 if (BB == Pred) in isBestSuccessor()
3125 if (BlockFilter && !BlockFilter->count(Pred)) in isBestSuccessor()
3127 BlockChain *PredChain = BlockToChain[Pred]; in isBestSuccessor()
3128 if (PredChain && (Pred != *std::prev(PredChain->end()))) in isBestSuccessor()
3133 for (MachineBasicBlock *Succ : Pred->successors()) in isBestSuccessor()
3140 BranchProbability SuccProb = MBPI->getEdgeProbability(Pred, Succ); in isBestSuccessor()
3145 BranchProbability BBProb = MBPI->getEdgeProbability(Pred, BB); in isBestSuccessor()
3151 BlockFrequency PredFreq = getBlockCountOrFrequency(Pred); in isBestSuccessor()
3224 for (MachineBasicBlock *Pred : Preds) { in findDuplicateCandidates()
3225 BlockFrequency PredFreq = getBlockCountOrFrequency(Pred); in findDuplicateCandidates()
3227 if (!TailDup.canTailDuplicate(BB, Pred)) { in findDuplicateCandidates()
3230 if (!Fallthrough && isBestSuccessor(BB, Pred, BlockFilter)) { in findDuplicateCandidates()
3231 Fallthrough = Pred; in findDuplicateCandidates()
3253 Candidates.push_back(Pred); in findDuplicateCandidates()