diff options
author | Martin Liska <mliska@suse.cz> | 2017-05-23 16:39:11 +0200 |
---|---|---|
committer | Martin Liska <marxin@gcc.gnu.org> | 2017-05-23 14:39:11 +0000 |
commit | 464d01188e46ccdb19b4783c5d28ef6bc72d32f9 (patch) | |
tree | 5307a5518829adcac991e9a7bab2b1ded50a7a3c /gcc/ipa-prop.c | |
parent | 6c52831d98b00d02a3c11b46fbf80991ef0dc0fa (diff) | |
download | gcc-464d01188e46ccdb19b4783c5d28ef6bc72d32f9.zip gcc-464d01188e46ccdb19b4783c5d28ef6bc72d32f9.tar.gz gcc-464d01188e46ccdb19b4783c5d28ef6bc72d32f9.tar.bz2 |
Introduce symtab_node::dump_{asm_,}name functions.
2017-05-23 Martin Liska <mliska@suse.cz>
* cgraph.c (cgraph_node::get_create): Use symtab_node::dump_{asm_,}name
functions.
(cgraph_edge::make_speculative): Likewise.
(cgraph_edge::resolve_speculation): Likewise.
(cgraph_edge::redirect_call_stmt_to_callee): Likewise.
(cgraph_node::dump): Likewise.
* cgraph.h: Likewise.
* cgraphunit.c (analyze_functions): Likewise.
(symbol_table::compile): Likewise.
* ipa-cp.c (print_all_lattices): Likewise.
(determine_versionability): Likewise.
(initialize_node_lattices): Likewise.
(ipcp_verify_propagated_values): Likewise.
(estimate_local_effects): Likewise.
(update_profiling_info): Likewise.
(create_specialized_node): Likewise.
(perhaps_add_new_callers): Likewise.
(decide_about_value): Likewise.
(decide_whether_version_node): Likewise.
(identify_dead_nodes): Likewise.
(ipcp_store_bits_results): Likewise.
* ipa-devirt.c (dump_targets): Likewise.
(ipa_devirt): Likewise.
* ipa-icf.c (sem_item::dump): Likewise.
(sem_function::equals): Likewise.
(sem_variable::equals): Likewise.
(sem_item_optimizer::read_section): Likewise.
(sem_item_optimizer::execute): Likewise.
(congruence_class::dump): Likewise.
* ipa-inline-analysis.c (dump_ipa_call_summary): Likewise.
(dump_inline_summary): Likewise.
(estimate_node_size_and_time): Likewise.
(inline_analyze_function): Likewise.
* ipa-inline-transform.c (inline_call): Likewise.
* ipa-inline.c (report_inline_failed_reason): Likewise.
(want_early_inline_function_p): Likewise.
(edge_badness): Likewise.
(update_edge_key): Likewise.
(inline_small_functions): Likewise.
* ipa-profile.c (ipa_profile): Likewise.
* ipa-prop.c (ipa_print_node_jump_functions): Likewise.
(ipa_make_edge_direct_to_target): Likewise.
(remove_described_reference): Likewise.
(ipa_impossible_devirt_target): Likewise.
(propagate_controlled_uses): Likewise.
(ipa_print_node_params): Likewise.
(ipcp_transform_function): Likewise.
* ipa-pure-const.c (pure_const_read_summary): Likewise.
(propagate_pure_const): Likewise.
* ipa-reference.c (generate_summary): Likewise.
(read_write_all_from_decl): Likewise.
(propagate): Likewise.
(ipa_reference_read_optimization_summary): Likewise.
* ipa-utils.c (ipa_merge_profiles): Likewise.
* ipa.c (walk_polymorphic_call_targets): Likewise.
(symbol_table::remove_unreachable_nodes): Likewise.
(ipa_single_use): Likewise.
* passes.c (execute_todo): Likewise.
* predict.c (drop_profile): Likewise.
* symtab.c (symtab_node::get_dump_name): New function.
(symtab_node::dump_name): Likewise.
(symtab_node::dump_asm_name): Likewise.
(symtab_node::dump_references): Likewise.
(symtab_node::dump_referring): Likewise.
(symtab_node::dump_base): Likewise.
(symtab_node::debug_symtab): Likewise.
* tree-sra.c (convert_callers_for_node): Likewise.
* tree-ssa-structalias.c (ipa_pta_execute): Likewise.
* value-prof.c (init_node_map): Likewise.
2017-05-23 Martin Liska <mliska@suse.cz>
* lto-symtab.c (lto_cgraph_replace_node): Use
symtab_node::dump_{asm_,}name functions.
* lto.c (read_cgraph_and_symbols): Likewise.
(do_whole_program_analysis): Likewise.
From-SVN: r248369
Diffstat (limited to 'gcc/ipa-prop.c')
-rw-r--r-- | gcc/ipa-prop.c | 90 |
1 files changed, 36 insertions, 54 deletions
diff --git a/gcc/ipa-prop.c b/gcc/ipa-prop.c index 2770d03..81fbb52 100644 --- a/gcc/ipa-prop.c +++ b/gcc/ipa-prop.c @@ -416,17 +416,15 @@ ipa_print_node_jump_functions (FILE *f, struct cgraph_node *node) { struct cgraph_edge *cs; - fprintf (f, " Jump functions of caller %s/%i:\n", node->name (), - node->order); + fprintf (f, " Jump functions of caller %s:\n", node->dump_name ()); for (cs = node->callees; cs; cs = cs->next_callee) { if (!ipa_edge_args_info_available_for_edge_p (cs)) continue; - fprintf (f, " callsite %s/%i -> %s/%i : \n", - xstrdup_for_dump (node->name ()), node->order, - xstrdup_for_dump (cs->callee->name ()), - cs->callee->order); + fprintf (f, " callsite %s -> %s : \n", + node->dump_name (), + cs->callee->dump_name ()); ipa_print_node_jump_functions_for_edge (f, cs); } @@ -2854,9 +2852,8 @@ ipa_make_edge_direct_to_target (struct cgraph_edge *ie, tree target, { location_t loc = gimple_location_safe (ie->call_stmt); dump_printf_loc (MSG_OPTIMIZED_LOCATIONS, loc, - "discovered direct call non-invariant " - "%s/%i\n", - ie->caller->name (), ie->caller->order); + "discovered direct call non-invariant %s\n", + ie->caller->dump_name ()); } return NULL; } @@ -2866,9 +2863,9 @@ ipa_make_edge_direct_to_target (struct cgraph_edge *ie, tree target, { location_t loc = gimple_location_safe (ie->call_stmt); dump_printf_loc (MSG_OPTIMIZED_LOCATIONS, loc, - "discovered direct call to non-function in %s/%i, " + "discovered direct call to non-function in %s, " "making it __builtin_unreachable\n", - ie->caller->name (), ie->caller->order); + ie->caller->dump_name ()); } target = builtin_decl_implicit (BUILT_IN_UNREACHABLE); @@ -2895,11 +2892,9 @@ ipa_make_edge_direct_to_target (struct cgraph_edge *ie, tree target, { if (dump_file) fprintf (dump_file, "ipa-prop: Discovered call to a known target " - "(%s/%i -> %s/%i) but can not refer to it. Giving up.\n", - xstrdup_for_dump (ie->caller->name ()), - ie->caller->order, - xstrdup_for_dump (ie->callee->name ()), - ie->callee->order); + "(%s -> %s) but can not refer to it. Giving up.\n", + ie->caller->dump_name (), + ie->callee->dump_name ()); return NULL; } callee = cgraph_node::get_create (target); @@ -2915,24 +2910,18 @@ ipa_make_edge_direct_to_target (struct cgraph_edge *ie, tree target, != callee->ultimate_alias_target ()) { if (dump_file) - fprintf (dump_file, "ipa-prop: Discovered call to a speculative target " - "(%s/%i -> %s/%i) but the call is already speculated to %s/%i. Giving up.\n", - xstrdup_for_dump (ie->caller->name ()), - ie->caller->order, - xstrdup_for_dump (callee->name ()), - callee->order, - xstrdup_for_dump (e2->callee->name ()), - e2->callee->order); + fprintf (dump_file, "ipa-prop: Discovered call to a speculative " + "target (%s -> %s) but the call is already " + "speculated to %s. Giving up.\n", + ie->caller->dump_name (), callee->dump_name (), + e2->callee->dump_name ()); } else { if (dump_file) fprintf (dump_file, "ipa-prop: Discovered call to a speculative target " - "(%s/%i -> %s/%i) this agree with previous speculation.\n", - xstrdup_for_dump (ie->caller->name ()), - ie->caller->order, - xstrdup_for_dump (callee->name ()), - callee->order); + "(%s -> %s) this agree with previous speculation.\n", + ie->caller->dump_name (), callee->dump_name ()); } return NULL; } @@ -2949,13 +2938,11 @@ ipa_make_edge_direct_to_target (struct cgraph_edge *ie, tree target, if (dump_file && !unreachable) { fprintf (dump_file, "ipa-prop: Discovered %s call to a %s target " - "(%s/%i -> %s/%i), for stmt ", + "(%s -> %s), for stmt ", ie->indirect_info->polymorphic ? "a virtual" : "an indirect", speculative ? "speculative" : "known", - xstrdup_for_dump (ie->caller->name ()), - ie->caller->order, - xstrdup_for_dump (callee->name ()), - callee->order); + ie->caller->dump_name (), + callee->dump_name ()); if (ie->call_stmt) print_gimple_stmt (dump_file, ie->call_stmt, 2, TDF_SLIM); else @@ -3155,9 +3142,8 @@ remove_described_reference (symtab_node *symbol, struct ipa_cst_ref_desc *rdesc) to_del->remove_reference (); if (dump_file) - fprintf (dump_file, "ipa-prop: Removed a reference from %s/%i to %s.\n", - xstrdup_for_dump (origin->caller->name ()), - origin->caller->order, xstrdup_for_dump (symbol->name ())); + fprintf (dump_file, "ipa-prop: Removed a reference from %s to %s.\n", + origin->caller->dump_name (), xstrdup_for_dump (symbol->name ())); return true; } @@ -3272,13 +3258,13 @@ ipa_impossible_devirt_target (struct cgraph_edge *ie, tree target) { if (target) fprintf (dump_file, - "Type inconsistent devirtualization: %s/%i->%s\n", - ie->caller->name (), ie->caller->order, + "Type inconsistent devirtualization: %s->%s\n", + ie->caller->dump_name (), IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (target))); else fprintf (dump_file, - "No devirtualization target in %s/%i\n", - ie->caller->name (), ie->caller->order); + "No devirtualization target in %s\n", + ie->caller->dump_name ()); } tree new_target = builtin_decl_implicit (BUILT_IN_UNREACHABLE); cgraph_node::get_create (new_target); @@ -3607,10 +3593,9 @@ propagate_controlled_uses (struct cgraph_edge *cs) { if (dump_file) fprintf (dump_file, "ipa-prop: Removing cloning-created " - "reference from %s/%i to %s/%i.\n", - xstrdup_for_dump (new_root->name ()), - new_root->order, - xstrdup_for_dump (n->name ()), n->order); + "reference from %s to %s.\n", + new_root->dump_name (), + n->dump_name ()); ref->remove_reference (); } } @@ -3648,11 +3633,9 @@ propagate_controlled_uses (struct cgraph_edge *cs) if (dump_file) fprintf (dump_file, "ipa-prop: Removing " "cloning-created reference " - "from %s/%i to %s/%i.\n", - xstrdup_for_dump (clone->name ()), - clone->order, - xstrdup_for_dump (n->name ()), - n->order); + "from %s to %s.\n", + clone->dump_name (), + n->dump_name ()); ref->remove_reference (); } clone = clone->callers->caller; @@ -4030,8 +4013,7 @@ ipa_print_node_params (FILE *f, struct cgraph_node *node) if (!node->definition) return; info = IPA_NODE_REF (node); - fprintf (f, " function %s/%i parameter descriptors:\n", - node->name (), node->order); + fprintf (f, " function %s parameter descriptors:\n", node->dump_name ()); count = ipa_get_param_count (info); for (i = 0; i < count; i++) { @@ -5849,8 +5831,8 @@ ipcp_transform_function (struct cgraph_node *node) gcc_checking_assert (current_function_decl); if (dump_file) - fprintf (dump_file, "Modification phase of node %s/%i\n", - node->name (), node->order); + fprintf (dump_file, "Modification phase of node %s\n", + node->dump_name ()); ipcp_update_bits (node); ipcp_update_vr (node); |