From: hubicka Date: Mon, 12 Oct 2015 18:54:01 +0000 (+0000) Subject: revert: X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f37b104aa2d2890c48a941033ab8dfd4131bd7da;p=thirdparty%2Fgcc.git revert: 2015-10-11 Jan Hubicka * cgraphbuild.c (compute_call_stmt_bb_frequency): Use counts when these are more informative. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@228736 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 32ec554fb912..61e46ff8c561 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2015-10-11 Jan Hubicka + + revert: + 2015-10-11 Jan Hubicka + * cgraphbuild.c (compute_call_stmt_bb_frequency): Use + counts when these are more informative. + 2015-10-12 Jeff Law * tree-ssa-threadbackward.c (fsm_find_thread_path): Remove diff --git a/gcc/cgraphbuild.c b/gcc/cgraphbuild.c index a7b4af6d9fb3..33b01be83acf 100644 --- a/gcc/cgraphbuild.c +++ b/gcc/cgraphbuild.c @@ -202,21 +202,15 @@ compute_call_stmt_bb_frequency (tree decl, basic_block bb) { int entry_freq = ENTRY_BLOCK_PTR_FOR_FN (DECL_STRUCT_FUNCTION (decl))->frequency; - gcov_type entry_count = ENTRY_BLOCK_PTR_FOR_FN - (DECL_STRUCT_FUNCTION (decl))->count; - gcov_type freq = bb->frequency; + int freq = bb->frequency; if (profile_status_for_fn (DECL_STRUCT_FUNCTION (decl)) == PROFILE_ABSENT) return CGRAPH_FREQ_BASE; - if (entry_count > entry_freq) - freq = RDIV (bb->count * CGRAPH_FREQ_BASE, entry_count); - else - { - if (!entry_freq) - entry_freq = 1, freq++; - freq = RDIV (freq * CGRAPH_FREQ_BASE, entry_freq); - } + if (!entry_freq) + entry_freq = 1, freq++; + + freq = freq * CGRAPH_FREQ_BASE / entry_freq; if (freq > CGRAPH_FREQ_MAX) freq = CGRAPH_FREQ_MAX;