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

Unified Diff: runtime/vm/flow_graph.cc

Issue 14268019: Basic support for LICM of fully invariant loads. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: review ready Created 7 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
« no previous file with comments | « runtime/vm/flow_graph.h ('k') | runtime/vm/flow_graph_optimizer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/flow_graph.cc
diff --git a/runtime/vm/flow_graph.cc b/runtime/vm/flow_graph.cc
index a6c8527a9f9af5a3b2f3bdc78bf97710962a8000..8ebce642853a3e7c8ce4312503fceaa13975199a 100644
--- a/runtime/vm/flow_graph.cc
+++ b/runtime/vm/flow_graph.cc
@@ -36,7 +36,9 @@ FlowGraph::FlowGraph(const FlowGraphBuilder& builder,
postorder_(),
reverse_postorder_(),
block_effects_(NULL),
- licm_allowed_(true) {
+ licm_allowed_(true),
+ loop_headers_(NULL),
+ loop_invariant_loads_(NULL) {
DiscoverBlocks();
}
@@ -110,6 +112,8 @@ void FlowGraph::DiscoverBlocks() {
// Block effects are using postorder numbering. Discard computed information.
block_effects_ = NULL;
+ loop_headers_ = NULL;
+ loop_invariant_loads_ = NULL;
}
@@ -957,8 +961,10 @@ static void FindLoop(BlockEntryInstr* m,
}
-void FlowGraph::ComputeLoops(GrowableArray<BlockEntryInstr*>* loop_headers) {
- ASSERT(loop_headers->is_empty());
+ZoneGrowableArray<BlockEntryInstr*>* FlowGraph::ComputeLoops() {
+ ZoneGrowableArray<BlockEntryInstr*>* loop_headers =
+ new ZoneGrowableArray<BlockEntryInstr*>();
+
for (BlockIterator it = postorder_iterator();
!it.Done();
it.Advance()) {
@@ -975,6 +981,8 @@ void FlowGraph::ComputeLoops(GrowableArray<BlockEntryInstr*>* loop_headers) {
}
}
}
+
+ return loop_headers;
}
« no previous file with comments | « runtime/vm/flow_graph.h ('k') | runtime/vm/flow_graph_optimizer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698