diff options
author | hubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-08-24 17:11:13 +0000 |
---|---|---|
committer | hubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-08-24 17:11:13 +0000 |
commit | 9ca785fc57ebdd48721e53015838bc90892339a4 (patch) | |
tree | e4ad7a1bdbd2155344888e32eac895842bc01109 /gcc/ipa-cp.c | |
parent | 7fd88f6e1b82d16da049005c9e2951ba5e885111 (diff) | |
download | gcc-9ca785fc57ebdd48721e53015838bc90892339a4.tar.gz |
* ipa-cp.c (ipcp_analyze_node): New function.
(ipcp_update_cloned_node): Use it.
(ipcp_init_stage): Likewise.
* ipa-inline.c (function_insertion_hook_holder): New static var.
(analyze_function): Break out from ....
(inline_generate_summary): Here; register insertion hook.
(cgraph_decide_inlining): Remove hook.
(add_new_function): New function.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@139536 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ipa-cp.c')
-rw-r--r-- | gcc/ipa-cp.c | 38 |
1 files changed, 21 insertions, 17 deletions
diff --git a/gcc/ipa-cp.c b/gcc/ipa-cp.c index 78a24bcb717..ad43298ae4e 100644 --- a/gcc/ipa-cp.c +++ b/gcc/ipa-cp.c @@ -159,6 +159,18 @@ ipcp_init_cloned_node (struct cgraph_node *orig_node, ipa_create_param_decls_array (new_node); } +/* Perform intraprocedrual analysis needed for ipcp. */ +static void +ipcp_analyze_node (struct cgraph_node *node) +{ + /* Unreachable nodes should have been eliminated before ipcp. */ + gcc_assert (node->needed || node->reachable); + + ipa_count_formal_params (node); + ipa_create_param_decls_array (node); + ipa_detect_param_modifications (node); +} + /* Recompute all local information since node might've got new direct calls after clonning. */ static void @@ -169,15 +181,13 @@ ipcp_update_cloned_node (struct cgraph_node *new_node) current_function_decl = new_node->decl; rebuild_cgraph_edges (); + /* Indirect inlinng rely on fact that we've already analyzed + the body.. */ if (flag_indirect_inlining) { struct cgraph_edge *cs; - ipa_check_create_node_params (); - ipa_count_formal_params (new_node); - ipa_create_param_decls_array (new_node); - ipa_detect_param_modifications (new_node); - ipa_analyze_params_uses (new_node); + ipcp_analyze_node (new_node); for (cs = new_node->callees; cs; cs = cs->next_callee) { @@ -418,18 +428,12 @@ ipcp_init_stage (void) struct cgraph_edge *cs; for (node = cgraph_nodes; node; node = node->next) - { - if (!node->analyzed) - continue; - /* Unreachable nodes should have been eliminated before ipcp. */ - gcc_assert (node->needed || node->reachable); - - ipa_count_formal_params (node); - ipa_create_param_decls_array (node); - ipcp_initialize_node_lattices (node); - ipa_detect_param_modifications (node); - ipcp_compute_node_scale (node); - } + if (node->analyzed) + { + ipcp_analyze_node (node); + ipcp_initialize_node_lattices (node); + ipcp_compute_node_scale (node); + } for (node = cgraph_nodes; node; node = node->next) { if (!node->analyzed) |