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

Unified Diff: runtime/vm/flow_graph_builder.cc

Issue 12334007: Reapply "Change the SSA construction pass to also construct def-use chains." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: 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.cc ('k') | runtime/vm/flow_graph_inliner.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/flow_graph_builder.cc
diff --git a/runtime/vm/flow_graph_builder.cc b/runtime/vm/flow_graph_builder.cc
index f4c1fb35fe423efb8fc69a014f7f08e5952fcd20..e5119005c0b4c5edd8bc74106954c7c73e4d3a9e 100644
--- a/runtime/vm/flow_graph_builder.cc
+++ b/runtime/vm/flow_graph_builder.cc
@@ -136,6 +136,7 @@ void ValueInliningContext::ReplaceCall(FlowGraph* caller_graph,
} else if (num_exits == 1) {
// For just one exit, replace the uses and remove the call from the graph.
call->ReplaceUsesWith(ValueAt(0)->definition());
+ ValueAt(0)->RemoveFromUseList();
call->previous()->LinkTo(callee_entry->next());
LastInstructionAt(0)->LinkTo(call->next());
// In case of control flow, locally update the predecessors, phis and
@@ -210,6 +211,12 @@ void ValueInliningContext::ReplaceCall(FlowGraph* caller_graph,
}
// Replace uses of the call with the phi.
call->ReplaceUsesWith(phi);
+ } else {
+ // In the case that the result is unused, remove the return value uses
+ // from their definition's use list.
+ for (intptr_t i = 0; i < num_exits; ++i) {
+ ValueAt(i)->RemoveFromUseList();
+ }
}
// Remove the call from the graph.
call->previous()->LinkTo(callee_entry->next());
« no previous file with comments | « runtime/vm/flow_graph.cc ('k') | runtime/vm/flow_graph_inliner.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698