aboutsummaryrefslogtreecommitdiff
path: root/lib/Transforms/Utils
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Transforms/Utils')
-rw-r--r--lib/Transforms/Utils/SimplifyCFG.cpp7
1 files changed, 1 insertions, 6 deletions
diff --git a/lib/Transforms/Utils/SimplifyCFG.cpp b/lib/Transforms/Utils/SimplifyCFG.cpp
index a952422fc2..72f878337e 100644
--- a/lib/Transforms/Utils/SimplifyCFG.cpp
+++ b/lib/Transforms/Utils/SimplifyCFG.cpp
@@ -1041,7 +1041,6 @@ static bool FoldTwoEntryPHINode(PHINode *PN) {
// that need to be moved to the dominating block.
std::set<Instruction*> AggressiveInsts;
- bool CanPromote = true;
BasicBlock::iterator AfterPHIIt = BB->begin();
while (isa<PHINode>(AfterPHIIt)) {
PHINode *PN = cast<PHINode>(AfterPHIIt++);
@@ -1054,14 +1053,10 @@ static bool FoldTwoEntryPHINode(PHINode *PN) {
&AggressiveInsts) ||
!DominatesMergePoint(PN->getIncomingValue(1), BB,
&AggressiveInsts)) {
- CanPromote = false;
+ return false;
}
}
- // Did we eliminate all PHI's?
- if (!CanPromote && AfterPHIIt != BB->begin())
- return false;
-
// If we all PHI nodes are promotable, check to make sure that all
// instructions in the predecessor blocks can be promoted as well. If
// not, we won't be able to get rid of the control flow, so it's not