Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(99)

Unified Diff: src/compiler/osr.cc

Issue 1157023002: [turbofan] Change End to take a variable number of inputs. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/compiler/osr.cc
diff --git a/src/compiler/osr.cc b/src/compiler/osr.cc
index d8ccc79c9fd89ca06a11459f281a8166958ccf26..81b97bb6295f8ea7b89c6f4d797d5b9284e5d19f 100644
--- a/src/compiler/osr.cc
+++ b/src/compiler/osr.cc
@@ -228,20 +228,15 @@ static void PeelOuterLoopsForOsr(Graph* graph, CommonOperatorBuilder* common,
}
// Merge the ends of the graph copies.
- Node* end = graph->end();
- tmp_inputs.clear();
- for (int i = -1; i < static_cast<int>(copies.size()); i++) {
- Node* input = end->InputAt(0);
- if (i >= 0) input = copies[i]->at(input->id());
- if (input->opcode() == IrOpcode::kMerge) {
- for (Node* node : input->inputs()) tmp_inputs.push_back(node);
- } else {
- tmp_inputs.push_back(input);
+ Node* const end = graph->end();
+ int const input_count = end->InputCount();
+ for (int i = 0; i < input_count; ++i) {
+ NodeId const id = end->InputAt(i)->id();
+ for (NodeVector* const copy : copies) {
+ end->AppendInput(graph->zone(), copy->at(id));
+ end->set_op(common->End(end->InputCount()));
}
}
- int count = static_cast<int>(tmp_inputs.size());
- Node* merge = graph->NewNode(common->Merge(count), count, &tmp_inputs[0]);
- end->ReplaceInput(0, merge);
if (FLAG_trace_turbo_graph) { // Simple textual RPO.
OFStream os(stdout);

Powered by Google App Engine
This is Rietveld 408576698