diff mbox series

Fix quality tracking for named probabilities

Message ID 20180123100351.GB48396@kam.mff.cuni.cz
State New
Headers show
Series Fix quality tracking for named probabilities | expand

Commit Message

Jan Hubicka Jan. 23, 2018, 10:03 a.m. UTC
Hi,
this is first patch of two which aim to fix function partitioning issues where
we put basic blocks to cold sections while we should not.

This patch fixes issues where we think we have precise profile information but
we don't because we scaled it by some of named probability values.  It is nature
of these that we use them in contexts where we don't know precise outcome.
So I changed them all to guessed.  This prevents us from wrong function
splitting decisions.

Bootstrapped/regtested x86_64-linux, comitted.

Honza

	* profile-count.h (profile_probability::very_unlikely,
	profile_probability::unlikely, profile_probability::even): Set
	precision to guessed.
diff mbox series

Patch

Index: profile-count.h
===================================================================
--- profile-count.h	(revision 256973)
+++ profile-count.h	(working copy)
@@ -164,7 +164,7 @@  public:
     {
       /* Be consistent with PROB_VERY_UNLIKELY in predict.h.  */
       profile_probability r
-	 = profile_probability::always ().apply_scale (1, 2000);
+	 = profile_probability::guessed_always ().apply_scale (1, 2000);
       r.m_val--;
       return r;
     }
@@ -172,13 +172,13 @@  public:
     {
       /* Be consistent with PROB_VERY_LIKELY in predict.h.  */
       profile_probability r
-	 = profile_probability::always ().apply_scale (1, 5);
+	 = profile_probability::guessed_always ().apply_scale (1, 5);
       r.m_val--;
       return r;
     }
   static profile_probability even ()
     {
-      return profile_probability::always ().apply_scale (1, 2);
+      return profile_probability::guessed_always ().apply_scale (1, 2);
     }
   static profile_probability very_likely ()
     {