diff options
author | Jan Hubicka <jh@suse.cz> | 2020-10-31 10:18:06 +0100 |
---|---|---|
committer | Jan Hubicka <jh@suse.cz> | 2020-10-31 10:18:06 +0100 |
commit | ae7a23a3fab74ebd45203d48fa09681c9945ee7a (patch) | |
tree | dd288d22c32cd5f609204c5a62c74dd025194459 /gcc/cgraphclones.c | |
parent | 617695cdc2b3d950f1e4deb5ea85d5cc302943f4 (diff) | |
download | gcc-ae7a23a3fab74ebd45203d48fa09681c9945ee7a.zip gcc-ae7a23a3fab74ebd45203d48fa09681c9945ee7a.tar.gz gcc-ae7a23a3fab74ebd45203d48fa09681c9945ee7a.tar.bz2 |
Move clone_info to summary
* Makefile.in: (OBJS): Add symtab-clones.o
(GTFILES): Add symtab-clones.h
* cgraph.c: Include symtab-clones.h.
(cgraph_edge::resolve_speculation): Fix formating
(cgraph_edge::redirect_call_stmt_to_callee): Update.
(cgraph_update_edges_for_call_stmt): Update
(release_function_body): Fix formating.
(cgraph_node::remove): Fix formating.
(cgraph_node::dump): Fix formating.
(cgraph_node::get_availability): Fix formating.
(cgraph_node::call_for_symbol_thunks_and_aliases): Fix formating.
(set_const_flag_1): Fix formating.
(set_pure_flag_1): Fix formating.
(cgraph_node::can_remove_if_no_direct_calls_p): Fix formating.
(collect_callers_of_node_1): Fix formating.
(clone_of_p): Update.
(cgraph_node::verify_node): Update.
(cgraph_c_finalize): Call clone_info::release ().
* cgraph.h (struct cgraph_clone_info): Move to symtab-clones.h.
(cgraph_node): Remove clone_info.
(symbol_table): Add m_clones.
* cgraphclones.c: Include symtab-clone.h.
(duplicate_thunk_for_node): Update.
(cgraph_node::create_clone): Update.
(cgraph_node::create_virtual_clone): Update.
(cgraph_node::find_replacement): Update.
(cgraph_node::materialize_clone): Update.
* gengtype.c (open_base_files): Include symtab-clones.h.
* ipa-cp.c: Include symtab-clones.h.
(initialize_node_lattices): Update.
(want_remove_some_param_p): Update.
(create_specialized_node): Update.
* ipa-fnsummary.c: Include symtab-clones.h.
(ipa_fn_summary_t::duplicate): Update.
* ipa-modref.c: Include symtab-clones.h.
(update_signature): Update.
* ipa-param-manipulation.c: Include symtab-clones.h.
(ipa_param_body_adjustments::common_initialization): Update.
* ipa-prop.c: Include symtab-clones.h.
(adjust_agg_replacement_values): Update.
(ipcp_get_parm_bits): Update.
(ipcp_update_bits): Update.
(ipcp_update_vr): Update.
* ipa-sra.c: Include symtab-clones.h.
(process_isra_node_results): Update.
(disable_unavailable_parameters): Update.
* lto-cgraph.c: Include symtab-clone.h.
(output_cgraph_opt_summary_p): Update.
(output_node_opt_summary): Update.
(input_node_opt_summary): Update.
* symtab-clones.cc: New file.
* symtab-clones.h: New file.
* tree-inline.c (expand_call_inline): Update.
(update_clone_info): Update.
(tree_function_versioning): Update.
Diffstat (limited to 'gcc/cgraphclones.c')
-rw-r--r-- | gcc/cgraphclones.c | 46 |
1 files changed, 29 insertions, 17 deletions
diff --git a/gcc/cgraphclones.c b/gcc/cgraphclones.c index 0ed6307..b5793f9 100644 --- a/gcc/cgraphclones.c +++ b/gcc/cgraphclones.c @@ -86,6 +86,7 @@ along with GCC; see the file COPYING3. If not see #include "ipa-prop.h" #include "ipa-fnsummary.h" #include "symtab-thunks.h" +#include "symtab-clones.h" /* Create clone of edge in the node N represented by CALL_EXPR the callgraph. */ @@ -201,16 +202,17 @@ duplicate_thunk_for_node (cgraph_node *thunk, cgraph_node *node) } tree new_decl; - if (node->clone.param_adjustments) + clone_info *info = clone_info::get (node); + if (info && info->param_adjustments) { /* We do not need to duplicate this_adjusting thunks if we have removed this. */ if (i->this_adjusting - && !node->clone.param_adjustments->first_param_intact_p ()) + && !info->param_adjustments->first_param_intact_p ()) return node; new_decl = copy_node (thunk->decl); - ipa_param_body_adjustments body_adj (node->clone.param_adjustments, + ipa_param_body_adjustments body_adj (info->param_adjustments, new_decl); body_adj.modify_formal_parameters (); } @@ -237,7 +239,9 @@ duplicate_thunk_for_node (cgraph_node *thunk, cgraph_node *node) new_thunk->thunk = thunk->thunk; new_thunk->unique_name = in_lto_p; new_thunk->former_clone_of = thunk->decl; - new_thunk->clone.param_adjustments = node->clone.param_adjustments; + if (info->param_adjustments) + clone_info::get_create (new_thunk)->param_adjustments + = info->param_adjustments; new_thunk->unit_id = thunk->unit_id; new_thunk->merged_comdat = thunk->merged_comdat; new_thunk->merged_extern_inline = thunk->merged_extern_inline; @@ -403,13 +407,16 @@ cgraph_node::create_clone (tree new_decl, profile_count prof_count, new_node->unit_id = unit_id; new_node->merged_comdat = merged_comdat; new_node->merged_extern_inline = merged_extern_inline; + clone_info *info = clone_info::get (this); if (param_adjustments) - new_node->clone.param_adjustments = param_adjustments; - else - new_node->clone.param_adjustments = clone.param_adjustments; - new_node->clone.tree_map = NULL; - new_node->clone.performed_splits = vec_safe_copy (clone.performed_splits); + clone_info::get_create (new_node)->param_adjustments = param_adjustments; + else if (info && info->param_adjustments) + clone_info::get_create (new_node)->param_adjustments + = info->param_adjustments; + if (info && info->performed_splits) + clone_info::get_create (new_node)->performed_splits + = vec_safe_copy (info->performed_splits); new_node->split_part = split_part; FOR_EACH_VEC_ELT (redirect_callers, i, e) @@ -616,7 +623,8 @@ cgraph_node::create_virtual_clone (vec<cgraph_edge *> redirect_callers, ABI support for this. */ set_new_clone_decl_and_node_flags (new_node); new_node->ipcp_clone = ipcp_clone; - new_node->clone.tree_map = tree_map; + if (tree_map) + clone_info::get_create (new_node)->tree_map = tree_map; if (!implicit_section) new_node->set_section (get_section ()); @@ -682,7 +690,9 @@ cgraph_node::find_replacement (void) clones = NULL; /* Copy clone info. */ - next_inline_clone->clone = clone; + clone_info *info = clone_info::get (this); + if (info) + *clone_info::get_create (next_inline_clone) = *info; /* Now place it into clone tree at same level at NODE. */ next_inline_clone->clone_of = clone_of; @@ -1087,6 +1097,7 @@ void cgraph_node::remove_from_clone_tree () void cgraph_node::materialize_clone () { + clone_info *info = clone_info::get (this); clone_of->get_untransformed_body (); former_clone_of = clone_of->decl; if (clone_of->former_clone_of) @@ -1096,15 +1107,15 @@ cgraph_node::materialize_clone () fprintf (symtab->dump_file, "cloning %s to %s\n", clone_of->dump_name (), dump_name ()); - if (clone.tree_map) + if (info->tree_map) { fprintf (symtab->dump_file, " replace map:"); for (unsigned int i = 0; - i < vec_safe_length (clone.tree_map); + i < vec_safe_length (info->tree_map); i++) { ipa_replace_map *replace_info; - replace_info = (*clone.tree_map)[i]; + replace_info = (*info->tree_map)[i]; fprintf (symtab->dump_file, "%s %i -> ", i ? "," : "", replace_info->parm_num); print_generic_expr (symtab->dump_file, @@ -1112,13 +1123,14 @@ cgraph_node::materialize_clone () } fprintf (symtab->dump_file, "\n"); } - if (clone.param_adjustments) - clone.param_adjustments->dump (symtab->dump_file); + if (info->param_adjustments) + info->param_adjustments->dump (symtab->dump_file); } clear_stmts_in_references (); /* Copy the OLD_VERSION_NODE function tree to the new version. */ tree_function_versioning (clone_of->decl, decl, - clone.tree_map, clone.param_adjustments, + info ? info->tree_map : NULL, + info ? info->param_adjustments : NULL, true, NULL, NULL); if (symtab->dump_file) { |