diff options
author | Jan Hubicka <hubicka@ucw.cz> | 2015-10-12 20:54:01 +0200 |
---|---|---|
committer | Jan Hubicka <hubicka@gcc.gnu.org> | 2015-10-12 18:54:01 +0000 |
commit | c22be554a6d49c27659afeeb71c78f574b8a9190 (patch) | |
tree | 99cb0a58fe43c2058da5bbe520715476c7de49c0 | |
parent | bba71f811c1d6e46cc22399e2be401640e7eb0cd (diff) | |
download | gcc-c22be554a6d49c27659afeeb71c78f574b8a9190.zip gcc-c22be554a6d49c27659afeeb71c78f574b8a9190.tar.gz gcc-c22be554a6d49c27659afeeb71c78f574b8a9190.tar.bz2 |
revert: cgraphbuild.c (compute_call_stmt_bb_frequency): Use counts when these are more informative.
revert:
2015-10-11 Jan Hubicka <hubicka@ucw.cz>
* cgraphbuild.c (compute_call_stmt_bb_frequency): Use
counts when these are more informative.
From-SVN: r228736
-rw-r--r-- | gcc/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/cgraphbuild.c | 16 |
2 files changed, 12 insertions, 11 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 32ec554..61e46ff 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2015-10-11 Jan Hubicka <hubicka@ucw.cz> + + revert: + 2015-10-11 Jan Hubicka <hubicka@ucw.cz> + * cgraphbuild.c (compute_call_stmt_bb_frequency): Use + counts when these are more informative. + 2015-10-12 Jeff Law <law@redhat.com> * tree-ssa-threadbackward.c (fsm_find_thread_path): Remove diff --git a/gcc/cgraphbuild.c b/gcc/cgraphbuild.c index a7b4af6..33b01be 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; |