From 97c07987a6d8052c77125b5f9841abc1f937b3eb Mon Sep 17 00:00:00 2001 From: Jan Hubicka Date: Wed, 24 Jan 2018 09:12:40 +0100 Subject: cfgcleanup.c (try_crossjump_to_edge): Use combine_with_count to merge probabilities. * cfgcleanup.c (try_crossjump_to_edge): Use combine_with_count to merge probabilities. * predict.c (probably_never_executed): Also mark as cold functions with global 0 profile and guessed local profile. * profile-count.c (profile_probability::combine_with_count): New member function. * profile-count.h (profile_probability::operator*, profile_probability::operator*=, profile_probability::operator/, profile_probability::operator/=): Reduce precision to adjusted and set value to guessed on contradictory divisions. (profile_probability::combine_with_freq): Remove. (profile_probability::combine_wiht_count): Declare. (profile_count::force_nonzero):: Set to adjusted. (profile_count::probability_in):: Set quality to adjusted. * tree-ssa-tail-merge.c (replace_block_by): Use combine_with_count. From-SVN: r257010 --- gcc/cfgcleanup.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'gcc/cfgcleanup.c') diff --git a/gcc/cfgcleanup.c b/gcc/cfgcleanup.c index c33022c..6892d80 100644 --- a/gcc/cfgcleanup.c +++ b/gcc/cfgcleanup.c @@ -2130,11 +2130,9 @@ try_crossjump_to_edge (int mode, edge e1, edge e2, if (FORWARDER_BLOCK_P (s2->dest)) s2->dest->count -= s->count (); - /* FIXME: Is this correct? Should be rewritten to count API. */ - if (redirect_edges_to->count.nonzero_p () && src1->count.nonzero_p ()) - s->probability = s->probability.combine_with_freq - (redirect_edges_to->count.to_frequency (cfun), - s2->probability, src1->count.to_frequency (cfun)); + s->probability = s->probability.combine_with_count + (redirect_edges_to->count, + s2->probability, src1->count); } /* Adjust count for the block. An earlier jump -- cgit v1.1