[llvm-branch-commits] [llvm] 85e7578 - Revert "[NFCI-ish][SimplifyCFG] FoldBranchToCommonDest(): really don't deal with uncond branches"
Roman Lebedev via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Fri Jan 22 06:43:06 PST 2021
Author: Roman Lebedev
Date: 2021-01-22T17:37:11+03:00
New Revision: 85e7578c6db81abb3283cb87fce8592f83ae0ea8
URL: https://github.com/llvm/llvm-project/commit/85e7578c6db81abb3283cb87fce8592f83ae0ea8
DIFF: https://github.com/llvm/llvm-project/commit/85e7578c6db81abb3283cb87fce8592f83ae0ea8.diff
LOG: 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 aabed3718ae25476c0f6b7e70c83ba4658f00e5c.
Added:
Modified:
llvm/lib/Transforms/Utils/SimplifyCFG.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Transforms/Utils/SimplifyCFG.cpp b/llvm/lib/Transforms/Utils/SimplifyCFG.cpp
index 4191f2104f3d..5fbcdd6abf6d 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.
More information about the llvm-branch-commits
mailing list