+2012-11-08 Jan Hubicka <jh@suse.cz>
+
+ PR middle-end/48636
+ * ipa-inline.c (big_speedup_p): New function.
+ (want_inline_small_function_p): Use it.
+ (edge_badness): Dump it.
+ * params.def (inline-min-speedup): New parameter.
+ * doc/invoke.texi (inline-min-speedup): Document.
+
2012-11-08 Martin Jambor <mjambor@suse.cz>
* ipa-prop.c (determine_known_aggregate_parts): Skip writes to
be applied.
The default value is 40.
+@item inline-min-speedup
+When estimated performance improvement of caller + callee runtime exceeds this
+threshold (in precent), the function can be inlined regardless the limit on
+@option{--param max-inline-insns-single} and @option{--param
+max-inline-insns-auto}.
+
@item large-function-insns
The limit specifying really large functions. For functions larger than this
limit after inlining, inlining is constrained by
return time;
}
+/* Return true if the speedup for inlining E is bigger than
+ PARAM_MAX_INLINE_MIN_SPEEDUP. */
+
+static bool
+big_speedup_p (struct cgraph_edge *e)
+{
+ gcov_type time = compute_uninlined_call_time (inline_summary (e->callee),
+ e);
+ gcov_type inlined_time = compute_inlined_call_time (e,
+ estimate_edge_time (e));
+ if (time - inlined_time
+ > RDIV (time * PARAM_VALUE (PARAM_INLINE_MIN_SPEEDUP), 100))
+ return true;
+ return false;
+}
+
/* Return true if we are interested in inlining small function.
When REPORT is true, report reason to dump file. */
{
int growth = estimate_edge_growth (e);
inline_hints hints = estimate_edge_hints (e);
+ bool big_speedup = big_speedup_p (e);
if (growth <= 0)
;
hints suggests that inlining given function is very profitable. */
else if (DECL_DECLARED_INLINE_P (callee->symbol.decl)
&& growth >= MAX_INLINE_INSNS_SINGLE
+ && !big_speedup
&& !(hints & (INLINE_HINT_indirect_call
| INLINE_HINT_loop_iterations
| INLINE_HINT_loop_stride)))
Upgrade it to MAX_INLINE_INSNS_SINGLE when hints suggests that
inlining given function is very profitable. */
else if (!DECL_DECLARED_INLINE_P (callee->symbol.decl)
+ && !big_speedup
&& growth >= ((hints & (INLINE_HINT_indirect_call
| INLINE_HINT_loop_iterations
| INLINE_HINT_loop_stride))
growth,
edge_time);
dump_inline_hints (dump_file, hints);
+ if (big_speedup_p (edge))
+ fprintf (dump_file, " big_speedup");
fprintf (dump_file, "\n");
}
"Maximal estimated outcome of branch considered predictable",
2, 0, 50)
+DEFPARAM (PARAM_INLINE_MIN_SPEEDUP,
+ "inline-min-speedup",
+ "The minimal estimated speedup allowing inliner to ignore inline-insns-single and inline-isnsns-auto",
+ 10, 0, 0)
+
/* The single function inlining limit. This is the maximum size
of a function counted in internal gcc instructions (not in
real machine instructions) that is eligible for inlining