diff --git a/llvm/lib/Transforms/Utils/SimplifyCFG.cpp b/llvm/lib/Transforms/Utils/SimplifyCFG.cpp index 4191f2104f3d9..5fbcdd6abf6d1 100644 --- a/llvm/lib/Transforms/Utils/SimplifyCFG.cpp +++ b/llvm/lib/Transforms/Utils/SimplifyCFG.cpp @@ -2978,7 +2978,7 @@ bool llvm::FoldBranchToCommonDest(BranchInst *BI, DomTreeUpdater *DTU, unsigned BonusInstThreshold) { // If this block ends with an unconditional branch, // let SpeculativelyExecuteBB() deal with it. - if (!BI->isConditional() || is_splat(successors(BI))) + if (!BI->isConditional()) return false; BasicBlock *BB = BI->getParent(); @@ -3059,8 +3059,7 @@ bool llvm::FoldBranchToCommonDest(BranchInst *BI, DomTreeUpdater *DTU, // Check that we have two conditional branches. If there is a PHI node in // the common successor, verify that the same value flows in from both // blocks. - if (!PBI || PBI->isUnconditional() || is_splat(successors(PBI)) || - !SafeToMergeTerminators(BI, PBI)) + if (!PBI || PBI->isUnconditional() || !SafeToMergeTerminators(BI, PBI)) continue; // Determine if the two branches share a common destination.