Index: src/compiler/common-operator-reducer.cc |
diff --git a/src/compiler/common-operator-reducer.cc b/src/compiler/common-operator-reducer.cc |
index 14bf812243ce20fbb212d75a8cfd75ce26dc1fcb..52b9ca8389e0d02c14b51d7016d387ce7aea18c4 100644 |
--- a/src/compiler/common-operator-reducer.cc |
+++ b/src/compiler/common-operator-reducer.cc |
@@ -68,21 +68,20 @@ Reduction CommonOperatorReducer::ReduceBranch(Node* node) { |
Decision const decision = DecideCondition(cond); |
if (decision == Decision::kUnknown) return NoChange(); |
Node* const control = node->InputAt(1); |
- node->set_op(common()->Dead()); |
- node->TrimInputCount(0); |
+ if (!dead_.is_set()) dead_.set(graph()->NewNode(common()->Dead())); |
for (Node* const use : node->uses()) { |
switch (use->opcode()) { |
case IrOpcode::kIfTrue: |
- Replace(use, (decision == Decision::kTrue) ? control : node); |
+ Replace(use, (decision == Decision::kTrue) ? control : dead_.get()); |
break; |
case IrOpcode::kIfFalse: |
- Replace(use, (decision == Decision::kFalse) ? control : node); |
+ Replace(use, (decision == Decision::kFalse) ? control : dead_.get()); |
break; |
default: |
UNREACHABLE(); |
} |
} |
- return Changed(node); |
+ return Replace(dead_.get()); |
} |