Lines Matching refs:DestBB
423 bool canMergeBlocks(const BasicBlock *BB, const BasicBlock *DestBB) const;
425 bool isMergingEmptyBlockProfitable(BasicBlock *BB, BasicBlock *DestBB,
908 BasicBlock *DestBB = BI->getSuccessor(0); in findDestBlockOfMergeableEmptyBlock() local
909 if (DestBB == BB) in findDestBlockOfMergeableEmptyBlock()
912 if (!canMergeBlocks(BB, DestBB)) in findDestBlockOfMergeableEmptyBlock()
913 DestBB = nullptr; in findDestBlockOfMergeableEmptyBlock()
915 return DestBB; in findDestBlockOfMergeableEmptyBlock()
948 BasicBlock *DestBB = findDestBlockOfMergeableEmptyBlock(BB); in eliminateMostlyEmptyBlocks() local
949 if (!DestBB || in eliminateMostlyEmptyBlocks()
950 !isMergingEmptyBlockProfitable(BB, DestBB, Preheaders.count(BB))) in eliminateMostlyEmptyBlocks()
960 BasicBlock *DestBB, in isMergingEmptyBlockProfitable() argument
976 llvm::is_contained(successors(Pred), DestBB)) in isMergingEmptyBlockProfitable()
1007 if (!isa<PHINode>(DestBB->begin())) in isMergingEmptyBlockProfitable()
1014 for (BasicBlock *DestBBPred : predecessors(DestBB)) { in isMergingEmptyBlockProfitable()
1018 if (llvm::all_of(DestBB->phis(), [&](const PHINode &DestPN) { in isMergingEmptyBlockProfitable()
1036 DestBB == findDestBlockOfMergeableEmptyBlock(SameValueBB)) in isMergingEmptyBlockProfitable()
1047 const BasicBlock *DestBB) const { in canMergeBlocks()
1054 if (UI->getParent() != DestBB || !isa<PHINode>(UI)) in canMergeBlocks()
1059 if (UI->getParent() == DestBB) { in canMergeBlocks()
1074 const PHINode *DestBBPN = dyn_cast<PHINode>(DestBB->begin()); in canMergeBlocks()
1092 for (const PHINode &PN : DestBB->phis()) { in canMergeBlocks()
1131 BasicBlock *DestBB = BI->getSuccessor(0); in eliminateMostlyEmptyBlock() local
1134 << *BB << *DestBB); in eliminateMostlyEmptyBlock()
1138 if (BasicBlock *SinglePred = DestBB->getSinglePredecessor()) { in eliminateMostlyEmptyBlock()
1139 if (SinglePred != DestBB) { in eliminateMostlyEmptyBlock()
1143 MergeBlockIntoPredecessor(DestBB); in eliminateMostlyEmptyBlock()
1151 FreshBBs.erase(DestBB); in eliminateMostlyEmptyBlock()
1159 for (PHINode &PN : DestBB->phis()) { in eliminateMostlyEmptyBlock()
1186 BB->replaceAllUsesWith(DestBB); in eliminateMostlyEmptyBlock()
1190 LLVM_DEBUG(dbgs() << "AFTER:\n" << *DestBB << "\n\n\n"); in eliminateMostlyEmptyBlock()