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
This commit is contained in:
Jan Hubicka 2007-05-04 17:32:42 +02:00 committed by Jan Hubicka
parent 70aa27669b
commit 06ea1b8486
3 changed files with 18 additions and 5 deletions

View File

@ -1,3 +1,14 @@
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>
* config/bfin/bfin.md (<optab>di3): Now a define_expand which expands

View File

@ -668,6 +668,9 @@ cgraph_decide_recursive_inlining (struct cgraph_node *node)
int depth = 0;
int n = 0;
if (optimize_size)
return false;
if (DECL_DECLARED_INLINE_P (node->decl))
{
limit = PARAM_VALUE (PARAM_MAX_INLINE_INSNS_RECURSIVE);
@ -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,
&edge->inline_failed))
@ -1444,7 +1447,7 @@ cgraph_early_inlining (void)
if (sorrycount || errorcount)
return 0;
if (cgraph_decide_inlining_incrementally (node,
flag_unit_at_a_time
flag_unit_at_a_time || optimize_size
? INLINE_SIZE : INLINE_SPEED, 0))
{
timevar_push (TV_INTEGRATION);

View File

@ -796,9 +796,8 @@ decode_options (unsigned int argc, const char **argv)
if (optimize_size)
{
/* Inlining of very small functions usually reduces total size. */
set_param_value ("max-inline-insns-single", 5);
set_param_value ("max-inline-insns-auto", 5);
/* Inlining of functions reducing size is a good idea regardless
of them being declared inline. */
flag_inline_functions = 1;
/* We want to crossjump as much as possible. */