Commit 5330a79d by Jan Hubicka Committed by Jan Hubicka

cgraphbuild.c (compute_call_stmt_bb_frequency): Use counts when these are more informative.


	* cgraphbuild.c (compute_call_stmt_bb_frequency): Use
	counts when these are more informative.

From-SVN: r228703
parent 86b7136a
2015-10-11 Jan Hubicka <hubicka@ucw.cz> 2015-10-11 Jan Hubicka <hubicka@ucw.cz>
* cgraphbuild.c (compute_call_stmt_bb_frequency): Use
counts when these are more informative.
2015-10-11 Jan Hubicka <hubicka@ucw.cz>
* tree-profile.c (tree_profiling): Do not clear * tree-profile.c (tree_profiling): Do not clear
pure/const when not instrumenting. pure/const when not instrumenting.
(pass tree_profile): Add dump of symtab. (pass tree_profile): Add dump of symtab.
...@@ -202,15 +202,21 @@ compute_call_stmt_bb_frequency (tree decl, basic_block bb) ...@@ -202,15 +202,21 @@ compute_call_stmt_bb_frequency (tree decl, basic_block bb)
{ {
int entry_freq = ENTRY_BLOCK_PTR_FOR_FN int entry_freq = ENTRY_BLOCK_PTR_FOR_FN
(DECL_STRUCT_FUNCTION (decl))->frequency; (DECL_STRUCT_FUNCTION (decl))->frequency;
int freq = bb->frequency; gcov_type entry_count = ENTRY_BLOCK_PTR_FOR_FN
(DECL_STRUCT_FUNCTION (decl))->count;
gcov_type freq = bb->frequency;
if (profile_status_for_fn (DECL_STRUCT_FUNCTION (decl)) == PROFILE_ABSENT) if (profile_status_for_fn (DECL_STRUCT_FUNCTION (decl)) == PROFILE_ABSENT)
return CGRAPH_FREQ_BASE; return CGRAPH_FREQ_BASE;
if (!entry_freq) if (entry_count > entry_freq)
entry_freq = 1, freq++; freq = RDIV (bb->count * CGRAPH_FREQ_BASE, entry_count);
else
freq = freq * CGRAPH_FREQ_BASE / entry_freq; {
if (!entry_freq)
entry_freq = 1, freq++;
freq = RDIV (freq * CGRAPH_FREQ_BASE, entry_freq);
}
if (freq > CGRAPH_FREQ_MAX) if (freq > CGRAPH_FREQ_MAX)
freq = CGRAPH_FREQ_MAX; freq = CGRAPH_FREQ_MAX;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment