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
This commit is contained in:
Jan Hubicka 2018-11-28 21:29:24 +01:00 committed by Jan Hubicka
parent c3cc0122ca
commit f0dbeec7c5
2 changed files with 11 additions and 2 deletions

View File

@ -1,3 +1,8 @@
2018-11-28 Jan Hubicka <jh@suse.cz>
* profile-count.h (profile_count::split): Give better result when
splitting profile_probability::always.
2018-11-28 Vladimir Makarov <vmakarov@redhat.com>
PR target/88207

View File

@ -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;
}