From: Jan Hubicka Date: Wed, 28 Nov 2018 20:29:24 +0000 (+0100) Subject: profile-count.h (profile_count::split): Give better result when splitting profile_pro... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=f0dbeec7c506407aa7e02cc2df82057ea40ab457;p=gcc.git profile-count.h (profile_count::split): Give better result when splitting profile_probability::always. * profile-count.h (profile_count::split): Give better result when splitting profile_probability::always. From-SVN: r266584 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index f2e5d828e00..3c1f926e239 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2018-11-28 Jan Hubicka + + * profile-count.h (profile_count::split): Give better result when + splitting profile_probability::always. + 2018-11-28 Vladimir Makarov PR target/88207 diff --git a/gcc/profile-count.h b/gcc/profile-count.h index 5d3bcc75f6d..620d6b71457 100644 --- a/gcc/profile-count.h +++ b/gcc/profile-count.h @@ -447,8 +447,12 @@ public: { profile_probability ret = *this * cprob; /* The following is equivalent to: - *this = cprob.invert () * *this / ret.invert (); */ - *this = (*this - ret) / ret.invert (); + *this = cprob.invert () * *this / ret.invert (); + Avoid scaling when overall outcome is supposed to be always. + Without knowing that one is inverse of toher, the result would be + conservative. */ + if (!(*this == profile_probability::always ())) + *this = (*this - ret) / ret.invert (); return ret; }