aboutsummaryrefslogtreecommitdiff
path: root/gcc/ipa-inline-transform.c
diff options
context:
space:
mode:
authorJan Hubicka <jh@suse.cz>2012-08-10 09:52:23 +0200
committerJan Hubicka <hubicka@gcc.gnu.org>2012-08-10 07:52:23 +0000
commitc170d40f35ca1d3b3ee6b152066b0abef9c8c93a (patch)
treea4119dbf7cb9f4c8a3b1dcd3719430eb66b2d714 /gcc/ipa-inline-transform.c
parent938ff79ae799ad8e961c6562b31d20899c6a132b (diff)
downloadgcc-c170d40f35ca1d3b3ee6b152066b0abef9c8c93a.zip
gcc-c170d40f35ca1d3b3ee6b152066b0abef9c8c93a.tar.gz
gcc-c170d40f35ca1d3b3ee6b152066b0abef9c8c93a.tar.bz2
re PR middle-end/54146 (Very slow compile with attribute((flatten)))
PR middle-end/54146 * ipa-inline-transform.c (inline_call): Add UPDATE_OVERALL_SUMMARY parameter; honnor it. * ipa-inline.c (recursive_inlining): Update call of inline_call. (inline_small_functions): Likewise. (ipa_inline): Likewise. (inline_always_inline_functions): Likewise. (early_inline_small_functions): Likewise. (flatten_function): Do separate update of summary info. * ipa-inline.h (inline_update_overall_summary): Declare. (inline_call): Update. * ipa-inline-analysis.c (inline_merge_summary): Break out updating code to ... (inline_update_overall_summary): Likewise. From-SVN: r190283
Diffstat (limited to 'gcc/ipa-inline-transform.c')
-rw-r--r--gcc/ipa-inline-transform.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/gcc/ipa-inline-transform.c b/gcc/ipa-inline-transform.c
index d64c612..53c4687 100644
--- a/gcc/ipa-inline-transform.c
+++ b/gcc/ipa-inline-transform.c
@@ -193,13 +193,17 @@ clone_inlined_nodes (struct cgraph_edge *e, bool duplicate,
/* Mark edge E as inlined and update callgraph accordingly. UPDATE_ORIGINAL
specify whether profile of original function should be updated. If any new
indirect edges are discovered in the process, add them to NEW_EDGES, unless
- it is NULL. Return true iff any new callgraph edges were discovered as a
+ it is NULL. If UPDATE_OVERALL_SUMMARY is false, do not bother to recompute overall
+ size of caller after inlining. Caller is required to eventually do it via
+ inline_update_overall_summary.
+
+ Return true iff any new callgraph edges were discovered as a
result of inlining. */
bool
inline_call (struct cgraph_edge *e, bool update_original,
VEC (cgraph_edge_p, heap) **new_edges,
- int *overall_size)
+ int *overall_size, bool update_overall_summary)
{
int old_size = 0, new_size = 0;
struct cgraph_node *to = NULL;
@@ -244,6 +248,8 @@ inline_call (struct cgraph_edge *e, bool update_original,
old_size = inline_summary (to)->size;
inline_merge_summary (e);
+ if (update_overall_summary)
+ inline_update_overall_summary (to);
new_size = inline_summary (to)->size;
if (overall_size)
*overall_size += new_size - old_size;