Index: src/compiler/control-reducer.cc |
diff --git a/src/compiler/control-reducer.cc b/src/compiler/control-reducer.cc |
index 9d74b8a6a4fb001f26f581b55c80019631cd0cd4..87c5758a5036196fe5bfd4a0909f8a9905d4da59 100644 |
--- a/src/compiler/control-reducer.cc |
+++ b/src/compiler/control-reducer.cc |
@@ -133,7 +133,7 @@ class ControlReducerImpl { |
pop = false; // restart traversing successors of this node. |
break; |
} |
- if (NodeProperties::IsControl(succ) && |
+ if (succ->op()->ControlOutputCount() > 0 && |
!marked.IsReachableFromStart(succ)) { |
// {succ} is a control node and not yet reached from start. |
marked.Push(succ); |
@@ -157,7 +157,7 @@ class ControlReducerImpl { |
// Any control nodes not reachable from start are dead, even loops. |
for (size_t i = 0; i < nodes.size(); i++) { |
Node* node = nodes[i]; |
- if (NodeProperties::IsControl(node) && |
+ if (node->op()->ControlOutputCount() > 0 && |
!marked.IsReachableFromStart(node)) { |
ReplaceNode(node, dead()); // uses will be added to revisit queue. |
} |
@@ -192,16 +192,14 @@ class ControlReducerImpl { |
DCHECK(NodeProperties::IsControlEdge(edge)); |
if (edge.from() == branch) continue; |
switch (edge.from()->opcode()) { |
-#define CASE(Opcode) case IrOpcode::k##Opcode: |
- CONTROL_OP_LIST(CASE) |
-#undef CASE |
- // Update all control nodes (except {branch}) pointing to the {loop}. |
- edge.UpdateTo(if_true); |
+ case IrOpcode::kPhi: |
break; |
case IrOpcode::kEffectPhi: |
effects.push_back(edge.from()); |
break; |
default: |
+ // Update all control edges (except {branch}) pointing to the {loop}. |
+ edge.UpdateTo(if_true); |
break; |
} |
} |
@@ -389,7 +387,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) { |