diff options
author | H.J. Lu <hongjiu.lu@intel.com> | 2012-08-02 16:58:33 +0000 |
---|---|---|
committer | H.J. Lu <hjl@gcc.gnu.org> | 2012-08-02 09:58:33 -0700 |
commit | a8da72b86c262f75d65665c3803a658d8089a679 (patch) | |
tree | d7b9cce913a50eb193504126c582c39d052a604e /gcc/ipa.c | |
parent | ca26f665dd7204fa930dc7f6a936ac526cd66f74 (diff) | |
download | gcc-a8da72b86c262f75d65665c3803a658d8089a679.tar.gz |
Add free inline summary pass after pass_early_local_passes
PR middle-end/53321
PR middle-end/53865
* ipa-inline-analysis.c (inline_free_summary): Return if
inline_edge_summary_vec is NULL.
* ipa-split.c (execute_split_functions): Check if a function
is inlinable only if inline_edge_summary_vec != NULL.
* ipa.c (symtab_remove_unreachable_nodes): Restore
cgraph_propagate_frequency call when something was changed.
(free_inline_summary): New function.
(pass_ipa_free_inline_summary): New pass.
* passes.c (init_optimization_passes): Add
pass_ipa_free_inline_summary before pass_ipa_tree_profile.
* timevar.def (TV_IPA_FREE_INLINE_SUMMARY): New.
* tree-pass.h (pass_ipa_free_inline_summary): New.
From-SVN: r190090
Diffstat (limited to 'gcc/ipa.c')
-rw-r--r-- | gcc/ipa.c | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/gcc/ipa.c b/gcc/ipa.c index 9329d9b2375..e2705918077 100644 --- a/gcc/ipa.c +++ b/gcc/ipa.c @@ -448,6 +448,11 @@ symtab_remove_unreachable_nodes (bool before_inlining_p, FILE *file) verify_symtab (); #endif + /* If we removed something, perhaps profile could be improved. */ + if (changed && optimize && inline_edge_summary_vec) + FOR_EACH_DEFINED_FUNCTION (node) + cgraph_propagate_frequency (node); + return changed; } @@ -960,6 +965,34 @@ struct simple_ipa_opt_pass pass_ipa_function_and_variable_visibility = } }; +/* Free inline summary. */ + +static unsigned +free_inline_summary (void) +{ + inline_free_summary (); + return 0; +} + +struct simple_ipa_opt_pass pass_ipa_free_inline_summary = +{ + { + SIMPLE_IPA_PASS, + "*free_inline_summary", /* name */ + NULL, /* gate */ + free_inline_summary, /* execute */ + NULL, /* sub */ + NULL, /* next */ + 0, /* static_pass_number */ + TV_IPA_FREE_INLINE_SUMMARY, /* tv_id */ + 0, /* properties_required */ + 0, /* properties_provided */ + 0, /* properties_destroyed */ + 0, /* todo_flags_start */ + TODO_ggc_collect /* todo_flags_finish */ + } +}; + /* Do not re-run on ltrans stage. */ static bool |