From: hubicka Date: Wed, 28 Nov 2018 20:29:24 +0000 (+0000) Subject: * profile-count.h (profile_count::split): Give better result when X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c727bc5d65ca6aab4196c47571ad2188d4c23de5;p=thirdparty%2Fgcc.git * profile-count.h (profile_count::split): Give better result when splitting profile_probability::always. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@266584 138bc75d-0d04-0410-961f-82ee72b054a4 --- 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; }