diff options
author | marxin <marxin@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-06-25 16:55:46 +0000 |
---|---|---|
committer | marxin <marxin@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-06-25 16:55:46 +0000 |
commit | 51ce56522e8bd1777558279bf6857bb23e4598c7 (patch) | |
tree | b3a5f8f8784d867b1c0b7b15ee92950397c414aa /gcc/ipa-prop.c | |
parent | 83751f2c56d463b497b1f75fce4bfd5a9739d59c (diff) | |
download | gcc-51ce56522e8bd1777558279bf6857bb23e4598c7.tar.gz |
IPA REF refactoring
* Makefile.in: Removed header file (ipa-ref-inline.h).
* cgraph.c (cgraph_turn_edge_to_speculative): New IPA REF function
called.
(cgraph_speculative_call_info): Likewise.
(cgraph_for_node_thunks_and_aliases): Likewise.
(cgraph_for_node_and_aliases): Likewise.
(verify_cgraph_node): Likewise.
* cgraph.h: Batch of IPA REF functions become member functions of
symtab_node: add_reference, maybe_add_reference, clone_references,
clone_referring, clone_reference, find_reference,
remove_stmt_references, remove_all_references,
remove_all_referring, dump_references, dump_referring,
has_alias_p, iterate_reference, iterate_referring.
* cgraphbuild.c (record_reference): New IPA REF function used.
(record_type_list): Likewise.
(record_eh_tables): Likewise.
(mark_address): Likewise.
(mark_load): Likewise.
(mark_store): Likewise.
(pass_build_cgraph_edges): Likewise.
(rebuild_cgraph_edge): Likewise.
(cgraph_rebuild_references): Likewise.
(pass_remove_cgraph_callee_edges): Likewise.
* cgraphclones.c (cgraph_clone_node): Likewise.
(cgraph_create_virtual_clone): Likewise.
(cgraph_materialize_clone): Likewise.
(cgraph_materialize_all_clones): Likewise.
* cgraphunit.c (cgraph_reset_node): Likewise.
(cgraph_reset_node): Likewise.
(analyze_function): Likewise.
(assemble_thunks_and_aliases): Likewise.
(expand_function): Likewise.
* ipa-comdats.c (propagate_comdat_group): Likewise.
(enqueue_references): Likewise.
* ipa-cp.c (ipcp_discover_new_direct_edges): Likewise.
(create_specialized_node): Likewise.
* ipa-devirt.c (referenced_from_vtable_p): Likewise.
* ipa-inline-transform.c (can_remove_node_now_p_1): Likewise.
* ipa-inline.c (reset_edge_caches): Likewise.
(update_caller_keys): Likewise.
(execute): Likewise.
* ipa-prop.c (remove_described_reference): Likewise.
(propagate_controlled_uses): Likewise.
(ipa_edge_duplication_hook): Likewise.
(ipa_modify_call_arguments): Likewise.
* ipa-pure-const.c (propagate_pure_const): Likewise.
* ipa-ref-inline.h: Header file removed, functions moved
to symtab_node class.
* ipa-ref.c (remove_reference): New class member function.
(cannot_lead_to_return): New class member function.
(referring_ref_list): Likewise.
(referred_ref_list): Likewise.
Rest of functions moved to symtab_node class.
* ipa-ref.h: New member functions remove_reference,
cannot_lead_to_return, referring_ref_list, referred_ref_list added
to ipa_ref class.
ipa_ref_list class has new member functions: first_reference,
first_referring, clear, nreferences.
* ipa-reference.c (analyze_function): New IPA REF function used.
(write_node_summary_p): Likewise.
(ipa_reference_write_optimization_summary): Likewise.
* ipa-split.c (split_function): Likewise.
* ipa-utils.c (ipa_reverse_postorder): Likewise.
* ipa-visibility.c (cgraph_non_local_node_p_1): Likewise.
(function_and_variable_visibility): Likewise.
* ipa.c (has_addr_references_p): Likewise.
(process_references): Argument type changed.
(symtab_remove_unreachable_nodes): New IPA REF function used.
(process_references): Likewise.
(set_writeonly_bit): Likewise.
* lto-cgraph.c: Implementation of new symtab_node member functions
that uses new IPA REF functions.
* lto-streamer-in.c (fixup_call_stmt_edges_1): New IPA REF function used.
* lto-streamer-out.c (output_symbol_p): Likewise.
* lto-streamer.h (referenced_from_this_partition_p): Argument type
changed.
* lto/lto-partition.c (add_references_to_partition): New IPA REF function
used.
(add_symbol_to_partition_1): Likewise.
(lto_balanced_map): Likewise.
* lto/lto-symtab.c (lto_cgraph_replace_node): Likewise.
* symtab.c: Implementation of new IPA REF API.
* trans-mem.c (ipa_tm_create_version_alias): New IPA REF function used.
(ipa_tm_create_version): Likewise.
(ipa_tm_execute): Likewise.
* tree-emutls.c (gen_emutls_addr): Likewise.
* tree-inline.c (copy_bb): Likewise.
(delete_unreachable_blocks_update_callgraph): Likewise.
* varpool.c (varpool_remove_unreferenced_decls): Likewise.
(varpool_for_node_and_aliases): Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@211987 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ipa-prop.c')
-rw-r--r-- | gcc/ipa-prop.c | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/gcc/ipa-prop.c b/gcc/ipa-prop.c index d9dca52d47f..5f5bf891a5d 100644 --- a/gcc/ipa-prop.c +++ b/gcc/ipa-prop.c @@ -2806,12 +2806,12 @@ remove_described_reference (symtab_node *symbol, struct ipa_cst_ref_desc *rdesc) origin = rdesc->cs; if (!origin) return false; - to_del = ipa_find_reference (origin->caller, symbol, - origin->call_stmt, origin->lto_stmt_uid); + to_del = origin->caller->find_reference (symbol, origin->call_stmt, + origin->lto_stmt_uid); if (!to_del) return false; - ipa_remove_reference (to_del); + to_del->remove_reference (); if (dump_file) fprintf (dump_file, "ipa-prop: Removed a reference from %s/%i to %s.\n", xstrdup (origin->caller->name ()), @@ -3209,8 +3209,7 @@ propagate_controlled_uses (struct cgraph_edge *cs) if (t && TREE_CODE (t) == ADDR_EXPR && TREE_CODE (TREE_OPERAND (t, 0)) == FUNCTION_DECL && (n = cgraph_get_node (TREE_OPERAND (t, 0))) - && (ref = ipa_find_reference (new_root, - n, NULL, 0))) + && (ref = new_root->find_reference (n, NULL, 0))) { if (dump_file) fprintf (dump_file, "ipa-prop: Removing cloning-created " @@ -3218,7 +3217,7 @@ propagate_controlled_uses (struct cgraph_edge *cs) xstrdup (new_root->name ()), new_root->order, xstrdup (n->name ()), n->order); - ipa_remove_reference (ref); + ref->remove_reference (); } } } @@ -3249,8 +3248,7 @@ propagate_controlled_uses (struct cgraph_edge *cs) && IPA_NODE_REF (clone)->ipcp_orig_node) { struct ipa_ref *ref; - ref = ipa_find_reference (clone, - n, NULL, 0); + ref = clone->find_reference (n, NULL, 0); if (ref) { if (dump_file) @@ -3261,7 +3259,7 @@ propagate_controlled_uses (struct cgraph_edge *cs) clone->order, xstrdup (n->name ()), n->order); - ipa_remove_reference (ref); + ref->remove_reference (); } clone = clone->callers->caller; } @@ -3455,10 +3453,10 @@ ipa_edge_duplication_hook (struct cgraph_edge *src, struct cgraph_edge *dst, struct ipa_ref *ref; symtab_node *n = cgraph_node_for_jfunc (src_jf); gcc_checking_assert (n); - ref = ipa_find_reference (src->caller, n, - src->call_stmt, src->lto_stmt_uid); + ref = src->caller->find_reference (n, src->call_stmt, + src->lto_stmt_uid); gcc_checking_assert (ref); - ipa_clone_ref (ref, dst->caller, ref->stmt); + dst->caller->clone_reference (ref, ref->stmt); gcc_checking_assert (ipa_refdesc_pool); struct ipa_cst_ref_desc *dst_rdesc @@ -3899,7 +3897,7 @@ ipa_modify_call_arguments (struct cgraph_edge *cs, gimple stmt, len = adjustments.length (); vargs.create (len); callee_decl = !cs ? gimple_call_fndecl (stmt) : cs->callee->decl; - ipa_remove_stmt_references (current_node, stmt); + current_node->remove_stmt_references (stmt); gsi = gsi_for_stmt (stmt); prev_gsi = gsi; |