aboutsummaryrefslogtreecommitdiff
path: root/gcc/predict.c
diff options
context:
space:
mode:
authorJan Hubicka <hubicka@ucw.cz>2017-11-18 23:55:56 +0100
committerJan Hubicka <hubicka@gcc.gnu.org>2017-11-18 22:55:56 +0000
commit517048cef0edf7ec35d7091ef4fea232edd48a53 (patch)
tree87fb8324893c35156edda2a67cd930e5e58da277 /gcc/predict.c
parent2563a16d3c7a56cd1e0cfe9b4ccb702edfb12312 (diff)
downloadgcc-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/predict.c')
-rw-r--r--gcc/predict.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/gcc/predict.c b/gcc/predict.c
index 7e40f77..0f34956 100644
--- a/gcc/predict.c
+++ b/gcc/predict.c
@@ -3607,9 +3607,6 @@ estimate_bb_frequencies (bool force)
to outermost to examine frequencies for back edges. */
estimate_loops ();
- bool global0 = ENTRY_BLOCK_PTR_FOR_FN (cfun)->count.initialized_p ()
- && ENTRY_BLOCK_PTR_FOR_FN (cfun)->count.ipa_p ();
-
freq_max = 0;
FOR_EACH_BB_FN (bb, cfun)
if (freq_max < BLOCK_INFO (bb)->frequency)
@@ -3618,6 +3615,7 @@ estimate_bb_frequencies (bool force)
freq_max = real_bb_freq_max / freq_max;
if (freq_max < 16)
freq_max = 16;
+ profile_count ipa_count = ENTRY_BLOCK_PTR_FOR_FN (cfun)->count.ipa ();
cfun->cfg->count_max = profile_count::uninitialized ();
FOR_BB_BETWEEN (bb, ENTRY_BLOCK_PTR_FOR_FN (cfun), NULL, next_bb)
{
@@ -3626,10 +3624,8 @@ estimate_bb_frequencies (bool force)
/* If we have profile feedback in which this function was never
executed, then preserve this info. */
- if (global0)
- bb->count = count.global0 ();
- else if (!(bb->count == profile_count::zero ()))
- bb->count = count.guessed_local ();
+ if (!(bb->count == profile_count::zero ()))
+ bb->count = count.guessed_local ().combine_with_ipa_count (ipa_count);
cfun->cfg->count_max = cfun->cfg->count_max.max (bb->count);
}