Commit b9aba9fd by Jan Hubicka Committed by Jan Hubicka

re PR middle-end/83665 (Big code size regression and some code quality improvement at Jan 2 2018)


	PR middle-end/83665
	* params.def (inline-min-speedup): Increase from 8 to 15.
	(max-inline-insns-auto): Decrease from 40 to 30.
	* ipa-split.c (consider_split): Add some buffer for function to
	be considered inlining candidate.
	* invoke.texi (max-inline-insns-auto, inline-min-speedup): UPdate
	default values.

From-SVN: r257582
parent 85c5e2f5
2018-02-08 Jan Hubicka <hubicka@ucw.cz>
PR middle-end/83665
* params.def (inline-min-speedup): Increase from 8 to 15.
(max-inline-insns-auto): Decrease from 40 to 30.
* ipa-split.c (consider_split): Add some buffer for function to
be considered inlining candidate.
* invoke.texi (max-inline-insns-auto, inline-min-speedup): UPdate
default values.
2018-02-12 Richard Biener <rguenther@suse.de> 2018-02-12 Richard Biener <rguenther@suse.de>
PR tree-optimization/84037 PR tree-optimization/84037
......
...@@ -10131,13 +10131,14 @@ a lot of functions that would otherwise not be considered for inlining ...@@ -10131,13 +10131,14 @@ a lot of functions that would otherwise not be considered for inlining
by the compiler are investigated. To those functions, a different by the compiler are investigated. To those functions, a different
(more restrictive) limit compared to functions declared inline can (more restrictive) limit compared to functions declared inline can
be applied. be applied.
The default value is 40. The default value is 30.
@item inline-min-speedup @item inline-min-speedup
When estimated performance improvement of caller + callee runtime exceeds this When estimated performance improvement of caller + callee runtime exceeds this
threshold (in percent), the function can be inlined regardless of the limit on threshold (in percent), the function can be inlined regardless of the limit on
@option{--param max-inline-insns-single} and @option{--param @option{--param max-inline-insns-single} and @option{--param
max-inline-insns-auto}. max-inline-insns-auto}.
The default value is 15.
@item large-function-insns @item large-function-insns
The limit specifying really large functions. For functions larger than this The limit specifying really large functions. For functions larger than this
...@@ -558,10 +558,13 @@ consider_split (struct split_point *current, bitmap non_ssa_vars, ...@@ -558,10 +558,13 @@ consider_split (struct split_point *current, bitmap non_ssa_vars,
" Refused: split size is smaller than call overhead\n"); " Refused: split size is smaller than call overhead\n");
return; return;
} }
/* FIXME: The logic here is not very precise, because inliner does use
inline predicates to reduce function body size. We add 10 to anticipate
that. Next stage1 we should try to be more meaningful here. */
if (current->header_size + call_overhead if (current->header_size + call_overhead
>= (unsigned int)(DECL_DECLARED_INLINE_P (current_function_decl) >= (unsigned int)(DECL_DECLARED_INLINE_P (current_function_decl)
? MAX_INLINE_INSNS_SINGLE ? MAX_INLINE_INSNS_SINGLE
: MAX_INLINE_INSNS_AUTO)) : MAX_INLINE_INSNS_AUTO) + 10)
{ {
if (dump_file && (dump_flags & TDF_DETAILS)) if (dump_file && (dump_flags & TDF_DETAILS))
fprintf (dump_file, fprintf (dump_file,
...@@ -574,7 +577,7 @@ consider_split (struct split_point *current, bitmap non_ssa_vars, ...@@ -574,7 +577,7 @@ consider_split (struct split_point *current, bitmap non_ssa_vars,
Limit this duplication. This is consistent with limit in tree-sra.c Limit this duplication. This is consistent with limit in tree-sra.c
FIXME: with LTO we ought to be able to do better! */ FIXME: with LTO we ought to be able to do better! */
if (DECL_ONE_ONLY (current_function_decl) if (DECL_ONE_ONLY (current_function_decl)
&& current->split_size >= (unsigned int) MAX_INLINE_INSNS_AUTO) && current->split_size >= (unsigned int) MAX_INLINE_INSNS_AUTO + 10)
{ {
if (dump_file && (dump_flags & TDF_DETAILS)) if (dump_file && (dump_flags & TDF_DETAILS))
fprintf (dump_file, fprintf (dump_file,
......
...@@ -52,13 +52,13 @@ DEFPARAM (PARAM_PREDICTABLE_BRANCH_OUTCOME, ...@@ -52,13 +52,13 @@ DEFPARAM (PARAM_PREDICTABLE_BRANCH_OUTCOME,
DEFPARAM (PARAM_INLINE_MIN_SPEEDUP, DEFPARAM (PARAM_INLINE_MIN_SPEEDUP,
"inline-min-speedup", "inline-min-speedup",
"The minimal estimated speedup allowing inliner to ignore inline-insns-single and inline-insns-auto.", "The minimal estimated speedup allowing inliner to ignore inline-insns-single and inline-insns-auto.",
8, 0, 0) 15, 0, 0)
/* The single function inlining limit. This is the maximum size /* The single function inlining limit. This is the maximum size
of a function counted in internal gcc instructions (not in of a function counted in internal gcc instructions (not in
real machine instructions) that is eligible for inlining real machine instructions) that is eligible for inlining
by the tree inliner. by the tree inliner.
The default value is 450. The default value is 400.
Only functions marked inline (or methods defined in the class Only functions marked inline (or methods defined in the class
definition for C++) are affected by this. definition for C++) are affected by this.
There are more restrictions to inlining: If inlined functions There are more restrictions to inlining: If inlined functions
...@@ -77,11 +77,11 @@ DEFPARAM (PARAM_MAX_INLINE_INSNS_SINGLE, ...@@ -77,11 +77,11 @@ DEFPARAM (PARAM_MAX_INLINE_INSNS_SINGLE,
that is applied to functions marked inlined (or defined in the that is applied to functions marked inlined (or defined in the
class declaration in C++) given by the "max-inline-insns-single" class declaration in C++) given by the "max-inline-insns-single"
parameter. parameter.
The default value is 40. */ The default value is 30. */
DEFPARAM (PARAM_MAX_INLINE_INSNS_AUTO, DEFPARAM (PARAM_MAX_INLINE_INSNS_AUTO,
"max-inline-insns-auto", "max-inline-insns-auto",
"The maximum number of instructions when automatically inlining.", "The maximum number of instructions when automatically inlining.",
40, 0, 0) 30, 0, 0)
DEFPARAM (PARAM_MAX_INLINE_INSNS_RECURSIVE, DEFPARAM (PARAM_MAX_INLINE_INSNS_RECURSIVE,
"max-inline-insns-recursive", "max-inline-insns-recursive",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment