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

Unified Diff: runtime/vm/compiler.cc

Issue 18111006: Collect edge count profiling data and reorder basic blocks. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Incorporated review comments. Created 7 years, 4 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/block_scheduler.cc ('k') | runtime/vm/flow_graph.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/compiler.cc
diff --git a/runtime/vm/compiler.cc b/runtime/vm/compiler.cc
index 9864e56417d311aea71e32c282ffa19e55b98662..a50bf18a53fcb9d98c50690091f4645b66328d8e 100644
--- a/runtime/vm/compiler.cc
+++ b/runtime/vm/compiler.cc
@@ -7,6 +7,7 @@
#include "vm/assembler.h"
#include "vm/ast_printer.h"
+#include "vm/block_scheduler.h"
#include "vm/code_generator.h"
#include "vm/code_patcher.h"
#include "vm/dart_entry.h"
@@ -52,6 +53,7 @@ DEFINE_FLAG(int, deoptimization_counter_licm_threshold, 8,
"How many times we allow deoptimization before we disable LICM.");
DEFINE_FLAG(bool, use_inlining, true, "Enable call-site inlining");
DEFINE_FLAG(bool, range_analysis, true, "Enable range analysis");
+DEFINE_FLAG(bool, reorder_basic_blocks, true, "Enable basic-block reordering.");
DEFINE_FLAG(bool, verify_compiler, false,
"Enable compiler verification assertions");
DECLARE_FLAG(bool, print_flow_graph);
@@ -305,6 +307,11 @@ static bool CompileParsedFunctionHelper(ParsedFunction* parsed_function,
}
}
+ BlockScheduler block_scheduler(flow_graph);
+ if (optimized && FLAG_reorder_basic_blocks) {
+ block_scheduler.AssignEdgeWeights();
+ }
+
if (optimized) {
TimerScope timer(FLAG_compiler_stats,
&CompilerStats::ssa_timer,
@@ -317,7 +324,6 @@ static bool CompileParsedFunctionHelper(ParsedFunction* parsed_function,
}
}
-
// Collect all instance fields that are loaded in the graph and
// have non-generic type feedback attached to them that can
// potentially affect optimizations.
@@ -504,6 +510,7 @@ static bool CompileParsedFunctionHelper(ParsedFunction* parsed_function,
// Perform register allocation on the SSA graph.
FlowGraphAllocator allocator(*flow_graph);
allocator.AllocateRegisters();
+ if (FLAG_reorder_basic_blocks) block_scheduler.ReorderBlocks();
if (FLAG_print_flow_graph || FLAG_print_flow_graph_optimized) {
FlowGraphPrinter::PrintGraph("After Optimizations", flow_graph);
@@ -511,9 +518,7 @@ static bool CompileParsedFunctionHelper(ParsedFunction* parsed_function,
}
Assembler assembler(use_far_branches);
- FlowGraphCompiler graph_compiler(&assembler,
- *flow_graph,
- optimized);
+ FlowGraphCompiler graph_compiler(&assembler, flow_graph, optimized);
{
TimerScope timer(FLAG_compiler_stats,
&CompilerStats::graphcompiler_timer,
« no previous file with comments | « runtime/vm/block_scheduler.cc ('k') | runtime/vm/flow_graph.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698