aboutsummaryrefslogtreecommitdiff
path: root/gcc/ipa.c
diff options
context:
space:
mode:
authorH.J. Lu <hongjiu.lu@intel.com>2012-08-02 16:58:33 +0000
committerH.J. Lu <hongjiu.lu@intel.com>2012-08-02 16:58:33 +0000
commit7955fcbe85db7b6800bf4d7072311f5dc7e4186e (patch)
treed7b9cce913a50eb193504126c582c39d052a604e /gcc/ipa.c
parent9ef5116e85130bc56f1876c49f93706e2c2a8629 (diff)
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. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@190090 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ipa.c')
-rw-r--r--gcc/ipa.c33
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