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

Unified Diff: runtime/vm/flow_graph_optimizer.cc

Issue 12316065: Set instruction/use_index when adding an input to an IL instruction. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Incorporated review comments. Created 7 years, 10 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
« no previous file with comments | « runtime/vm/flow_graph_builder.cc ('k') | runtime/vm/flow_graph_type_propagator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/flow_graph_optimizer.cc
diff --git a/runtime/vm/flow_graph_optimizer.cc b/runtime/vm/flow_graph_optimizer.cc
index e711fa08b5485ffbbc7953384e182664154b68f6..a9fbd4c13562cd849c0818be0470737e437d62df 100644
--- a/runtime/vm/flow_graph_optimizer.cc
+++ b/runtime/vm/flow_graph_optimizer.cc
@@ -3289,10 +3289,6 @@ class LoadOptimizer : public ValueObject {
Definition* replacement = (*pred_out_values)[expr_id]->Replacement();
Value* input = new Value(replacement);
phi->SetInputAt(i, input);
-
- // TODO(vegorov): add a helper function to handle input insertion.
- input->set_instruction(phi);
- input->set_use_index(i);
replacement->AddInputUse(input);
}
@@ -4285,9 +4281,7 @@ void ConstantPropagator::Transform() {
for (intptr_t phi_idx = 0; phi_idx < phis->length(); ++phi_idx) {
PhiInstr* phi = (*phis)[phi_idx];
if (phi == NULL) continue;
- Value* input = phi->inputs_[pred_idx];
- input->set_use_index(live_count);
- phi->inputs_[live_count] = input;
+ phi->SetInputAt(live_count, phi->InputAt(pred_idx));
}
}
++live_count;
@@ -4295,7 +4289,7 @@ void ConstantPropagator::Transform() {
for (intptr_t phi_idx = 0; phi_idx < phis->length(); ++phi_idx) {
PhiInstr* phi = (*phis)[phi_idx];
if (phi == NULL) continue;
- phi->inputs_[pred_idx]->RemoveFromUseList();
+ phi->InputAt(pred_idx)->RemoveFromUseList();
}
}
}
« no previous file with comments | « runtime/vm/flow_graph_builder.cc ('k') | runtime/vm/flow_graph_type_propagator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698