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-Tag: basepoints/gcc-10~2713 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f0dbeec7c506407aa7e02cc2df82057ea40ab457;p=thirdparty%2Fgcc.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 f2e5d828e003..3c1f926e239f 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 5d3bcc75f6d8..620d6b714579 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; }