Short circuit case where profiles are same.
authorJan Hubicka <hubicka@ucw.cz>
Sun, 10 Nov 2019 18:15:34 +0000 (19:15 +0100)
committerJan Hubicka <hubicka@gcc.gnu.org>
Sun, 10 Nov 2019 18:15:34 +0000 (18:15 +0000)
        * profile-count.c (profile_count::to_sreal_scale): Short circuit
case where profiles are same.

From-SVN: r278022

gcc/ChangeLog
gcc/profile-count.c

index bdc3067e63cdd88d8434972d75b72945db8af13f..d2c7242d794b5799922804a26d260532b3114917 100644 (file)
@@ -1,3 +1,8 @@
+2019-11-10  Jan Hubicka  <hubicka@ucw.cz>
+
+       * profile-count.c (profile_count::to_sreal_scale): Short circuit
+       case where profiles are same.
+
 2019-11-10  Jan Hubicka  <hubicka@ucw.cz>
 
        * cgraph.c (cgraph_edge::maybe_hot_p): Do not use sreal_frequency.
index 6198675eb89294a22944e2c2f6c0e57feb02e1d4..6f6c0a9e83235729aa71f164fc951be4d093b97b 100644 (file)
@@ -312,6 +312,8 @@ profile_count::to_sreal_scale (profile_count in, bool *known) const
     *known = true;
   if (*this == zero ())
     return 0;
+  if (m_val == in.m_val)
+    return 1;
 
   if (!in.m_val)
     {