From 6414f44000a781bc39eaa5a125d2f1ea0868e3cf Mon Sep 17 00:00:00 2001 From: rguenth Date: Mon, 12 Apr 2010 13:37:32 +0000 Subject: [PATCH 1/1] 2010-04-12 Richard Guenther * ipa.c (cgraph_postorder): Adjust postorder to guarantee single-iteration always-inline inlining. * ipa-inline.c (cgraph_mark_inline): Do not return anything. (cgraph_decide_inlining): Do not handle always-inline specially. (try_inline): Remove always-inline cycle detection special case. Do not recurse on always-inlines. (cgraph_early_inlining): Do not iterate if not optimizing. (cgraph_gate_early_inlining): remove. (pass_early_inline): Run unconditionally. (gate_cgraph_decide_inlining): New function. (pass_ipa_inline): Use it. Do not run the IPA inliner if not inlining or optimizing. (cgraph_decide_inlining_of_small_functions): Also consider always-inline functions. (cgraph_default_inline_p): Return true for nodes which should disregard inline limits. (estimate_function_body_sizes): Assume zero size and time for nodes which are marked as disregarding inline limits. (cgraph_decide_recursive_inlining): Do not perform recursive inlining on always-inline nodes. * gcc.dg/torture/inline-2.c: New testcase. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@158225 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 24 ++++++++++++++++++++++++ gcc/ipa-inline.c | 19 ++++++++----------- gcc/testsuite/ChangeLog | 4 ++++ 3 files changed, 36 insertions(+), 11 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 163bf0a1cbe..464ca7e5f18 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,27 @@ +2010-04-12 Richard Guenther + + * ipa.c (cgraph_postorder): Adjust postorder to guarantee + single-iteration always-inline inlining. + * ipa-inline.c (cgraph_mark_inline): Do not return anything. + (cgraph_decide_inlining): Do not handle always-inline + specially. + (try_inline): Remove always-inline cycle detection special case. + Do not recurse on always-inlines. + (cgraph_early_inlining): Do not iterate if not optimizing. + (cgraph_gate_early_inlining): remove. + (pass_early_inline): Run unconditionally. + (gate_cgraph_decide_inlining): New function. + (pass_ipa_inline): Use it. Do not run the IPA inliner if + not inlining or optimizing. + (cgraph_decide_inlining_of_small_functions): Also consider + always-inline functions. + (cgraph_default_inline_p): Return true for nodes which should + disregard inline limits. + (estimate_function_body_sizes): Assume zero size and time for + nodes which are marked as disregarding inline limits. + (cgraph_decide_recursive_inlining): Do not perform recursive + inlining on always-inline nodes. + 2010-04-12 Jakub Jelinek PR bootstrap/43699 diff --git a/gcc/ipa-inline.c b/gcc/ipa-inline.c index e1de7ce25cc..36d455d9bd1 100644 --- a/gcc/ipa-inline.c +++ b/gcc/ipa-inline.c @@ -1677,17 +1677,6 @@ cgraph_early_inlining (void) } else { - if (lookup_attribute ("flatten", - DECL_ATTRIBUTES (node->decl)) != NULL) - { - if (dump_file) - fprintf (dump_file, - "Flattening %s\n", cgraph_node_name (node)); - cgraph_flatten (node); - timevar_push (TV_INTEGRATION); - todo |= optimize_inline_calls (current_function_decl); - timevar_pop (TV_INTEGRATION); - } /* We iterate incremental inlining to get trivial cases of indirect inlining. */ while (iterations < PARAM_VALUE (PARAM_EARLY_INLINER_MAX_ITERATIONS) @@ -1840,6 +1829,14 @@ estimate_function_body_sizes (struct cgraph_node *node) int freq; tree funtype = TREE_TYPE (node->decl); + if (node->local.disregard_inline_limits) + { + inline_summary (node)->self_time = 0; + inline_summary (node)->self_size = 0; + inline_summary (node)->time_inlining_benefit = 0; + inline_summary (node)->size_inlining_benefit = 0; + } + if (dump_file) fprintf (dump_file, "Analyzing function body size: %s\n", cgraph_node_name (node)); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 88b78d0767a..7cb69b76b64 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2010-04-12 Richard Guenther + + * gcc.dg/torture/inline-2.c: New testcase. + 2010-04-12 Jakub Jelinek PR bootstrap/43699 -- 2.11.0