diff options
author | Jan Hubicka <hubicka@ucw.cz> | 2017-11-18 23:55:56 +0100 |
---|---|---|
committer | Jan Hubicka <hubicka@gcc.gnu.org> | 2017-11-18 22:55:56 +0000 |
commit | 517048cef0edf7ec35d7091ef4fea232edd48a53 (patch) | |
tree | 87fb8324893c35156edda2a67cd930e5e58da277 /gcc/cgraphclones.c | |
parent | 2563a16d3c7a56cd1e0cfe9b4ccb702edfb12312 (diff) | |
download | gcc-517048cef0edf7ec35d7091ef4fea232edd48a53.zip gcc-517048cef0edf7ec35d7091ef4fea232edd48a53.tar.gz gcc-517048cef0edf7ec35d7091ef4fea232edd48a53.tar.bz2 |
cgraphclones.c (cgraph_edge::clone): Rename gcov_count to prof_count.
* cgraphclones.c (cgraph_edge::clone): Rename gcov_count to prof_count.
(cgraph_edge::clone): Cleanup updating of profile.
* ipa-cp.c (update_profiling_info): Likewise.
* ipa-inline-transform.c (inline_transform): Likewise.
* ipa-inline.c (inline_small_functions): Add missing space to dump.
* ipa-split.c (execute_split_functions): Do not split when function
is cold.
* predict.c (estimate_bb_frequencies): Cleanup updating of profile.
* profile-count.c (profile_count::dump): Add global0.
(profile_count::to_cgraph_frequency): Do not ICE when entry is
undefined.
(profile_count::to_sreal_scale): Likewise.
(profile_count::adjust_for_ipa_scaling): Fix typo in comment.
(profile_count::combine_with_ipa_count): New function.
* profile-count.h (profile_guessed_global0adjusted): New.
(profile_count::adjusted_zero): New.
(profile_count::global0adjusted): New.
(profile_count::combine_with_ipa_count): New.
* tree-inline.c (copy_edges_for_bb): Add NUM/DEN arugment;
correct profile of return block of split functions.
(copy_cfg_body): Remove unused profile_count.
(copy_body): Likewise.
(expand_call_inline): Update.
(tree_function_versioning): Update.
From-SVN: r254919
Diffstat (limited to 'gcc/cgraphclones.c')
-rw-r--r-- | gcc/cgraphclones.c | 33 |
1 files changed, 10 insertions, 23 deletions
diff --git a/gcc/cgraphclones.c b/gcc/cgraphclones.c index a575a34..ef39d85 100644 --- a/gcc/cgraphclones.c +++ b/gcc/cgraphclones.c @@ -91,7 +91,7 @@ cgraph_edge::clone (cgraph_node *n, gcall *call_stmt, unsigned stmt_uid, { cgraph_edge *new_edge; profile_count::adjust_for_ipa_scaling (&num, &den); - profile_count gcov_count = count.apply_scale (num, den); + profile_count prof_count = count.apply_scale (num, den); if (indirect_unknown_callee) { @@ -104,19 +104,19 @@ cgraph_edge::clone (cgraph_node *n, gcall *call_stmt, unsigned stmt_uid, { cgraph_node *callee = cgraph_node::get (decl); gcc_checking_assert (callee); - new_edge = n->create_edge (callee, call_stmt, gcov_count); + new_edge = n->create_edge (callee, call_stmt, prof_count); } else { new_edge = n->create_indirect_edge (call_stmt, indirect_info->ecf_flags, - gcov_count, false); + prof_count, false); *new_edge->indirect_info = *indirect_info; } } else { - new_edge = n->create_edge (callee, call_stmt, gcov_count); + new_edge = n->create_edge (callee, call_stmt, prof_count); if (indirect_info) { new_edge->indirect_info @@ -135,12 +135,9 @@ cgraph_edge::clone (cgraph_node *n, gcall *call_stmt, unsigned stmt_uid, new_edge->in_polymorphic_cdtor = in_polymorphic_cdtor; /* Update IPA profile. Local profiles need no updating in original. */ - if (update_original - && count.ipa () == count && new_edge->count.ipa () == new_edge->count) - count -= new_edge->count; - else if (caller->count.global0 () == caller->count - && !(count == profile_count::zero ())) - count = count.global0 (); + if (update_original) + count = count.combine_with_ipa_count (count.ipa () + - new_edge->count.ipa ()); symtab->call_edge_duplication_hooks (this, new_edge); return new_edge; } @@ -431,22 +428,12 @@ cgraph_node::create_clone (tree new_decl, profile_count prof_count, if (new_inlined_to) dump_callgraph_transformation (this, new_inlined_to, "inlining to"); - if (prof_count == profile_count::zero () - && !(count == profile_count::zero ())) - prof_count = count.global0 (); - + prof_count = count.combine_with_ipa_count (prof_count); new_node->count = prof_count; /* Update IPA profile. Local profiles need no updating in original. */ - if (update_original && !(count == profile_count::zero ()) - && count.ipa () == count && prof_count.ipa () == prof_count) - { - if (count.nonzero_p () - && !(count - prof_count).nonzero_p ()) - count = count.global0 (); - else - count -= prof_count; - } + if (update_original) + count = count.combine_with_ipa_count (count.ipa () - prof_count.ipa ()); new_node->decl = new_decl; new_node->register_symbol (); new_node->origin = origin; |