Skip to content

Commit 85e7578

Browse files
committed
Revert "[NFCI-ish][SimplifyCFG] FoldBranchToCommonDest(): really don't deal with uncond branches"
Does not build in XCode: http://green.lab.llvm.org/green/job/clang-stage1-RA/17963/consoleFull#-1704658317a1ca8a51-895e-46c6-af87-ce24fa4cd561 This reverts commit aabed37.
1 parent d1a6f92 commit 85e7578

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

llvm/lib/Transforms/Utils/SimplifyCFG.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2978,7 +2978,7 @@ bool llvm::FoldBranchToCommonDest(BranchInst *BI, DomTreeUpdater *DTU,
29782978
unsigned BonusInstThreshold) {
29792979
// If this block ends with an unconditional branch,
29802980
// let SpeculativelyExecuteBB() deal with it.
2981-
if (!BI->isConditional() || is_splat(successors(BI)))
2981+
if (!BI->isConditional())
29822982
return false;
29832983

29842984
BasicBlock *BB = BI->getParent();
@@ -3059,8 +3059,7 @@ bool llvm::FoldBranchToCommonDest(BranchInst *BI, DomTreeUpdater *DTU,
30593059
// Check that we have two conditional branches. If there is a PHI node in
30603060
// the common successor, verify that the same value flows in from both
30613061
// blocks.
3062-
if (!PBI || PBI->isUnconditional() || is_splat(successors(PBI)) ||
3063-
!SafeToMergeTerminators(BI, PBI))
3062+
if (!PBI || PBI->isUnconditional() || !SafeToMergeTerminators(BI, PBI))
30643063
continue;
30653064

30663065
// Determine if the two branches share a common destination.

0 commit comments

Comments
 (0)