summaryrefslogtreecommitdiff
path: root/gcc/cgraphclones.c
diff options
context:
space:
mode:
authortejohnson <tejohnson@138bc75d-0d04-0410-961f-82ee72b054a4>2013-05-02 13:20:47 +0000
committertejohnson <tejohnson@138bc75d-0d04-0410-961f-82ee72b054a4>2013-05-02 13:20:47 +0000
commit7007400071d3afc1525ca1691c93ae77c509349f (patch)
treee9eaf4c390a4ad7d8e3e0600f9736eb3868af2dc /gcc/cgraphclones.c
parent4817649a7d71cac4236204ad8eecc15dee6bd6d9 (diff)
downloadgcc-7007400071d3afc1525ca1691c93ae77c509349f.tar.gz
Follow-on patch to r197595 to complete the replacement of truncating divides
in profile scaling code with rounding divide equivalents using helper routines in basic-block.h. In addition to bootstrap and profiledbootstrap builds and tests (with and without LTO), I built and tested performance of the SPEC cpu2006 benchmarks with FDO on a Nehalem system. I didn't see any performance changes that looked significant. 2013-05-02 Teresa Johnson <tejohnson@google.com> * loop-unswitch.c (unswitch_loop): Use helper routines with rounding divides. * cfg.c (update_bb_profile_for_threading): Ditto. * tree-inline.c (copy_bb): Ditto. (copy_edges_for_bb): Ditto. (initialize_cfun): Ditto. (copy_cfg_body): Ditto. (expand_call_inline): Ditto. * ipa-inline-analysis.c (estimate_edge_size_and_time): Ditto. (estimate_node_size_and_time): Ditto. (inline_merge_summary): Ditto. * cgraphclones.c (cgraph_clone_edge): Ditto. (cgraph_clone_node): Ditto. * sched-rgn.c (compute_dom_prob_ps): Ditto. (compute_trg_info): Ditto. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@198532 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cgraphclones.c')
-rw-r--r--gcc/cgraphclones.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/gcc/cgraphclones.c b/gcc/cgraphclones.c
index fa6a9113a1e..f015f18666c 100644
--- a/gcc/cgraphclones.c
+++ b/gcc/cgraphclones.c
@@ -102,8 +102,7 @@ cgraph_clone_edge (struct cgraph_edge *e, struct cgraph_node *n,
int freq_scale, bool update_original)
{
struct cgraph_edge *new_edge;
- /* Update this to use GCOV_COMPUTE_SCALE. */
- gcov_type count = e->count * count_scale / REG_BR_PROB_BASE;
+ gcov_type count = apply_probability (e->count, count_scale);
gcov_type freq;
/* We do not want to ignore loop nest after frequency drops to 0. */
@@ -205,8 +204,7 @@ cgraph_clone_node (struct cgraph_node *n, tree decl, gcov_type count, int freq,
if (new_node->count > n->count)
count_scale = REG_BR_PROB_BASE;
else
- /* Update to use GCOV_COMPUTE_SCALE. */
- count_scale = new_node->count * REG_BR_PROB_BASE / n->count;
+ count_scale = GCOV_COMPUTE_SCALE (new_node->count, n->count);
}
else
count_scale = 0;