Commit 06ea1b84 by Jan Hubicka Committed by Jan Hubicka

opts.c (decode_options): Do not fiddle with inlining parameters in case of optimizing for size.


	* opts.c (decode_options): Do not fiddle with inlining
	parameters in case of optimizing for size.
	* ipa-inline.c (cgraph_decide_recursive_inlining): When optimizing
	for size do nothing.
	(cgraph_decide_inlining_of_small_function): When optimizing for
	size never inline functions increasing caller size.
	(cgraph_early_inlining): Inline for size when optimizing for size.

Co-Authored-By: Richard Guenther <rguenther@suse.de>

From-SVN: r124431
parent 70aa2766
2007-05-04 Jan Hubicka <jh@suse.cz>
Richard Guenther <rguenther@suse.de>
* opts.c (decode_options): Do not fiddle with inlining
parameters in case of optimizing for size.
* ipa-inline.c (cgraph_decide_recursive_inlining): When optimizing
for size do nothing.
(cgraph_decide_inlining_of_small_function): When optimizing for
size never inline functions increasing caller size.
(cgraph_early_inlining): Inline for size when optimizing for size.
2007-04-18 Bernd Schmidt <bernd.schmidt@analog.com> 2007-04-18 Bernd Schmidt <bernd.schmidt@analog.com>
* config/bfin/bfin.md (<optab>di3): Now a define_expand which expands * config/bfin/bfin.md (<optab>di3): Now a define_expand which expands
......
...@@ -668,6 +668,9 @@ cgraph_decide_recursive_inlining (struct cgraph_node *node) ...@@ -668,6 +668,9 @@ cgraph_decide_recursive_inlining (struct cgraph_node *node)
int depth = 0; int depth = 0;
int n = 0; int n = 0;
if (optimize_size)
return false;
if (DECL_DECLARED_INLINE_P (node->decl)) if (DECL_DECLARED_INLINE_P (node->decl))
{ {
limit = PARAM_VALUE (PARAM_MAX_INLINE_INSNS_RECURSIVE); limit = PARAM_VALUE (PARAM_MAX_INLINE_INSNS_RECURSIVE);
...@@ -913,7 +916,7 @@ cgraph_decide_inlining_of_small_functions (void) ...@@ -913,7 +916,7 @@ cgraph_decide_inlining_of_small_functions (void)
} }
} }
if (!cgraph_maybe_hot_edge_p (edge) && growth > 0) if ((!cgraph_maybe_hot_edge_p (edge) || optimize_size) && growth > 0)
{ {
if (!cgraph_recursive_inlining_p (edge->caller, edge->callee, if (!cgraph_recursive_inlining_p (edge->caller, edge->callee,
&edge->inline_failed)) &edge->inline_failed))
...@@ -1444,7 +1447,7 @@ cgraph_early_inlining (void) ...@@ -1444,7 +1447,7 @@ cgraph_early_inlining (void)
if (sorrycount || errorcount) if (sorrycount || errorcount)
return 0; return 0;
if (cgraph_decide_inlining_incrementally (node, if (cgraph_decide_inlining_incrementally (node,
flag_unit_at_a_time flag_unit_at_a_time || optimize_size
? INLINE_SIZE : INLINE_SPEED, 0)) ? INLINE_SIZE : INLINE_SPEED, 0))
{ {
timevar_push (TV_INTEGRATION); timevar_push (TV_INTEGRATION);
......
...@@ -796,9 +796,8 @@ decode_options (unsigned int argc, const char **argv) ...@@ -796,9 +796,8 @@ decode_options (unsigned int argc, const char **argv)
if (optimize_size) if (optimize_size)
{ {
/* Inlining of very small functions usually reduces total size. */ /* Inlining of functions reducing size is a good idea regardless
set_param_value ("max-inline-insns-single", 5); of them being declared inline. */
set_param_value ("max-inline-insns-auto", 5);
flag_inline_functions = 1; flag_inline_functions = 1;
/* We want to crossjump as much as possible. */ /* We want to crossjump as much as possible. */
......
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