Lines Matching defs:DestBB
423 bool canMergeBlocks(const BasicBlock *BB, const BasicBlock *DestBB) const;
425 bool isMergingEmptyBlockProfitable(BasicBlock *BB, BasicBlock *DestBB,
908 BasicBlock *DestBB = BI->getSuccessor(0);
909 if (DestBB == BB)
912 if (!canMergeBlocks(BB, DestBB))
913 DestBB = nullptr;
915 return DestBB;
948 BasicBlock *DestBB = findDestBlockOfMergeableEmptyBlock(BB);
949 if (!DestBB ||
950 !isMergingEmptyBlockProfitable(BB, DestBB, Preheaders.count(BB)))
960 BasicBlock *DestBB,
976 llvm::is_contained(successors(Pred), DestBB))
982 // of PHIs in DestBB. In such case, merging BB and DestBB would cause ISel to
1004 // value for the PHIs in the DestBB, we consider them together. In such
1007 if (!isa<PHINode>(DestBB->begin()))
1013 // DestBB are the same as the ones from BB.
1014 for (BasicBlock *DestBBPred : predecessors(DestBB)) {
1018 if (llvm::all_of(DestBB->phis(), [&](const PHINode &DestPN) {
1036 DestBB == findDestBlockOfMergeableEmptyBlock(SameValueBB))
1043 /// Return true if we can merge BB into DestBB if there is a single
1047 const BasicBlock *DestBB) const {
1054 if (UI->getParent() != DestBB || !isa<PHINode>(UI))
1056 // If User is inside DestBB block and it is a PHINode then check
1059 if (UI->getParent() == DestBB) {
1071 // If BB and DestBB contain any common predecessors, then the phi nodes in BB
1072 // and DestBB may have conflicting incoming values for the block. If so, we
1074 const PHINode *DestBBPN = dyn_cast<PHINode>(DestBB->begin());
1088 // Walk the preds of DestBB.
1092 for (const PHINode &PN : DestBB->phis()) {
1131 BasicBlock *DestBB = BI->getSuccessor(0);
1134 << *BB << *DestBB);
1138 if (BasicBlock *SinglePred = DestBB->getSinglePredecessor()) {
1139 if (SinglePred != DestBB) {
1142 // Merge DestBB into SinglePred/BB and delete it.
1143 MergeBlockIntoPredecessor(DestBB);
1145 // DestBB(=its single successor) is the one that was deleted.
1151 FreshBBs.erase(DestBB);
1157 // Otherwise, we have multiple predecessors of BB. Update the PHIs in DestBB
1159 for (PHINode &PN : DestBB->phis()) {
1191 // DestBB and remove BB.
1192 BB->replaceAllUsesWith(DestBB);
1196 LLVM_DEBUG(dbgs() << "AFTER:\n" << *DestBB << "\n\n\n");