Index: src/compiler/graph-reducer.cc |
diff --git a/src/compiler/graph-reducer.cc b/src/compiler/graph-reducer.cc |
index 9a6b121ffbd224d2fe0e8bfed002fcf4ce312039..91049a4eb02e0d1587ea7b5ba6cfac640efb38d5 100644 |
--- a/src/compiler/graph-reducer.cc |
+++ b/src/compiler/graph-reducer.cc |
@@ -154,9 +154,11 @@ void GraphReducer::ReduceTop() { |
// Otherwise {node} was replaced by a new node. Replace all old uses of |
// {node} with {replacement}. New nodes created by this reduction can |
// use {node}. |
- node->ReplaceUsesIf( |
- [node_count](Node* const node) { return node->id() < node_count; }, |
- replacement); |
+ for (Edge edge : node->use_edges()) { |
+ if (edge.from()->id() < node_count) { |
+ edge.UpdateTo(replacement); |
+ } |
+ } |
// Unlink {node} if it's no longer used. |
if (node->uses().empty()) { |
node->Kill(); |