Lines Matching refs:DestBB
394 bool canMergeBlocks(const BasicBlock *BB, const BasicBlock *DestBB) const;
396 bool isMergingEmptyBlockProfitable(BasicBlock *BB, BasicBlock *DestBB,
762 BasicBlock *DestBB = BI->getSuccessor(0); in findDestBlockOfMergeableEmptyBlock() local
763 if (DestBB == BB) in findDestBlockOfMergeableEmptyBlock()
766 if (!canMergeBlocks(BB, DestBB)) in findDestBlockOfMergeableEmptyBlock()
767 DestBB = nullptr; in findDestBlockOfMergeableEmptyBlock()
769 return DestBB; in findDestBlockOfMergeableEmptyBlock()
798 BasicBlock *DestBB = findDestBlockOfMergeableEmptyBlock(BB); in eliminateMostlyEmptyBlocks() local
799 if (!DestBB || in eliminateMostlyEmptyBlocks()
800 !isMergingEmptyBlockProfitable(BB, DestBB, Preheaders.count(BB))) in eliminateMostlyEmptyBlocks()
810 BasicBlock *DestBB, in isMergingEmptyBlockProfitable() argument
827 if (DestBB == CBI->getSuccessor(i)) in isMergingEmptyBlockProfitable()
859 if (!isa<PHINode>(DestBB->begin())) in isMergingEmptyBlockProfitable()
866 for (BasicBlock *DestBBPred : predecessors(DestBB)) { in isMergingEmptyBlockProfitable()
870 if (llvm::all_of(DestBB->phis(), [&](const PHINode &DestPN) { in isMergingEmptyBlockProfitable()
888 DestBB == findDestBlockOfMergeableEmptyBlock(SameValueBB)) in isMergingEmptyBlockProfitable()
899 const BasicBlock *DestBB) const { in canMergeBlocks()
906 if (UI->getParent() != DestBB || !isa<PHINode>(UI)) in canMergeBlocks()
911 if (UI->getParent() == DestBB) { in canMergeBlocks()
926 const PHINode *DestBBPN = dyn_cast<PHINode>(DestBB->begin()); in canMergeBlocks()
943 for (const PHINode &PN : DestBB->phis()) { in canMergeBlocks()
965 BasicBlock *DestBB = BI->getSuccessor(0); in eliminateMostlyEmptyBlock() local
968 << *BB << *DestBB); in eliminateMostlyEmptyBlock()
972 if (BasicBlock *SinglePred = DestBB->getSinglePredecessor()) { in eliminateMostlyEmptyBlock()
973 if (SinglePred != DestBB) { in eliminateMostlyEmptyBlock()
977 MergeBlockIntoPredecessor(DestBB); in eliminateMostlyEmptyBlock()
987 for (PHINode &PN : DestBB->phis()) { in eliminateMostlyEmptyBlock()
1014 BB->replaceAllUsesWith(DestBB); in eliminateMostlyEmptyBlock()
1018 LLVM_DEBUG(dbgs() << "AFTER:\n" << *DestBB << "\n\n\n"); in eliminateMostlyEmptyBlock()