Index: src/compiler/osr.cc |
diff --git a/src/compiler/osr.cc b/src/compiler/osr.cc |
index b0592c9d4ccbe3086740a1d8fb434930cdd327e0..32485823646901bf41000d69b3d71a0011d0de41 100644 |
--- a/src/compiler/osr.cc |
+++ b/src/compiler/osr.cc |
@@ -48,10 +48,6 @@ static void PeelOuterLoopsForOsr(Graph* graph, CommonOperatorBuilder* common, |
// Prepare the mapping for OSR values and the OSR loop entry. |
mapping->at(osr_normal_entry->id()) = dead; |
mapping->at(osr_loop_entry->id()) = dead; |
- // Don't duplicate the OSR values. |
- for (Node* use : osr_loop_entry->uses()) { |
- if (use->opcode() == IrOpcode::kOsrValue) mapping->at(use->id()) = use; |
- } |
// The outer loops are dead in this copy. |
for (LoopTree::Loop* outer = loop->parent(); outer; |
@@ -69,8 +65,9 @@ static void PeelOuterLoopsForOsr(Graph* graph, CommonOperatorBuilder* common, |
// Mapping already exists. |
continue; |
} |
- if (orig->InputCount() == 0) { |
- // No need to copy leaf nodes. |
+ if (orig->InputCount() == 0 || orig->opcode() == IrOpcode::kParameter || |
+ orig->opcode() == IrOpcode::kOsrValue) { |
+ // No need to copy leaf nodes or parameters. |
mapping->at(orig->id()) = orig; |
continue; |
} |