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

Unified Diff: runtime/vm/flow_graph_inliner.cc

Issue 11975061: Removed loop depth info tracking at graph build time. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 11 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_optimizer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/flow_graph_inliner.cc
===================================================================
--- runtime/vm/flow_graph_inliner.cc (revision 17406)
+++ runtime/vm/flow_graph_inliner.cc (working copy)
@@ -26,8 +26,6 @@
"Inline function calls up to threshold nesting depth");
DEFINE_FLAG(int, inlining_size_threshold, 20,
"Always inline functions that have threshold or fewer instructions");
-DEFINE_FLAG(int, inlining_in_loop_size_threshold, 80,
- "Inline functions in loops that have threshold or fewer instructions");
DEFINE_FLAG(int, inlining_callee_call_sites_threshold, 1,
"Always inline functions containing threshold or fewer calls.");
DEFINE_FLAG(int, inlining_constant_arguments_count, 1,
@@ -303,8 +301,7 @@
function_cache_() { }
// Inlining heuristics based on Cooper et al. 2008.
- bool ShouldWeInline(intptr_t loop_depth,
- intptr_t instr_count,
+ bool ShouldWeInline(intptr_t instr_count,
intptr_t call_site_count,
intptr_t const_arg_count) {
if (instr_count <= FLAG_inlining_size_threshold) {
@@ -313,10 +310,6 @@
if (call_site_count <= FLAG_inlining_callee_call_sites_threshold) {
return true;
}
- if ((loop_depth > 0) &&
- (instr_count <= FLAG_inlining_in_loop_size_threshold)) {
- return true;
- }
if ((const_arg_count >= FLAG_inlining_constant_arguments_count) &&
(instr_count <= FLAG_inlining_constant_arguments_size_threshold)) {
return true;
@@ -385,18 +378,14 @@
return false;
}
- const intptr_t loop_depth = call->GetBlock()->loop_depth();
const intptr_t constant_arguments = CountConstants(*arguments);
- if (!ShouldWeInline(loop_depth,
- function.optimized_instruction_count(),
+ if (!ShouldWeInline(function.optimized_instruction_count(),
function.optimized_call_site_count(),
constant_arguments)) {
TRACE_INLINING(OS::Print(" Bailout: early heuristics with "
- "loop depth: %"Pd", "
"code size: %"Pd", "
"call sites: %"Pd", "
"const args: %"Pd"\n",
- loop_depth,
function.optimized_instruction_count(),
function.optimized_call_site_count(),
constant_arguments));
@@ -455,7 +444,7 @@
TimerScope timer(FLAG_compiler_stats,
&CompilerStats::graphinliner_build_timer,
isolate);
- callee_graph = builder.BuildGraph(loop_depth);
+ callee_graph = builder.BuildGraph();
}
// The parameter stubs are a copy of the actual arguments providing
@@ -537,13 +526,11 @@
function.set_optimized_call_site_count(info.call_site_count());
// Use heuristics do decide if this call should be inlined.
- if (!ShouldWeInline(loop_depth,
- size,
+ if (!ShouldWeInline(size,
info.call_site_count(),
constants_count)) {
// If size is larger than all thresholds, don't consider it again.
if ((size > FLAG_inlining_size_threshold) &&
- (size > FLAG_inlining_in_loop_size_threshold) &&
(size > FLAG_inlining_callee_call_sites_threshold) &&
(size > FLAG_inlining_constant_arguments_size_threshold)) {
function.set_is_inlinable(false);
@@ -552,11 +539,9 @@
isolate->set_deopt_id(prev_deopt_id);
isolate->set_ic_data_array(prev_ic_data.raw());
TRACE_INLINING(OS::Print(" Bailout: heuristics with "
- "loop depth: %"Pd", "
"code size: %"Pd", "
"call sites: %"Pd", "
"const args: %"Pd"\n",
- loop_depth,
size,
info.call_site_count(),
constants_count));
« no previous file with comments | « runtime/vm/flow_graph_builder.cc ('k') | runtime/vm/flow_graph_optimizer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698