Index: src/compiler/control-reducer.cc |
diff --git a/src/compiler/control-reducer.cc b/src/compiler/control-reducer.cc |
index 7f97254b372bf0c4c9a16fbddefd9a0938ca7acd..df302dd8ed838f37c6d7045cdea78d2be6b1c3b5 100644 |
--- a/src/compiler/control-reducer.cc |
+++ b/src/compiler/control-reducer.cc |
@@ -384,7 +384,8 @@ class ControlReducerImpl { |
// Reducer implementation: perform reductions on a node. |
//=========================================================================== |
Node* ReduceNode(Node* node) { |
- if (node->op()->ControlInputCount() == 1) { |
+ if (node->op()->ControlInputCount() == 1 || |
+ node->opcode() == IrOpcode::kLoop) { |
// If a node has only one control input and it is dead, replace with dead. |
Node* control = NodeProperties::GetControlInput(node); |
if (control->opcode() == IrOpcode::kDead) { |
@@ -611,21 +612,20 @@ void ControlReducer::TrimGraph(Zone* zone, JSGraph* jsgraph) { |
} |
-Node* ControlReducer::ReducePhiForTesting(JSGraph* jsgraph, |
- CommonOperatorBuilder* common, |
- Node* node) { |
+Node* ControlReducer::ReduceMerge(JSGraph* jsgraph, |
+ CommonOperatorBuilder* common, Node* node) { |
Zone zone; |
ControlReducerImpl impl(&zone, jsgraph, common); |
- return impl.ReducePhi(node); |
+ return impl.ReduceMerge(node); |
} |
-Node* ControlReducer::ReduceMergeForTesting(JSGraph* jsgraph, |
- CommonOperatorBuilder* common, |
- Node* node) { |
+Node* ControlReducer::ReducePhiForTesting(JSGraph* jsgraph, |
+ CommonOperatorBuilder* common, |
+ Node* node) { |
Zone zone; |
ControlReducerImpl impl(&zone, jsgraph, common); |
- return impl.ReduceMerge(node); |
+ return impl.ReducePhi(node); |
} |