* cgraph.c (cgraph_edge::maybe_hot_p): Do not use sreal_frequency.
authorJan Hubicka <hubicka@ucw.cz>
Sun, 10 Nov 2019 18:10:51 +0000 (19:10 +0100)
committerJan Hubicka <hubicka@gcc.gnu.org>
Sun, 10 Nov 2019 18:10:51 +0000 (18:10 +0000)
From-SVN: r278021

gcc/ChangeLog
gcc/cgraph.c

index d07b88a3a6bc829fc0caa17c23883d2723d42fca..bdc3067e63cdd88d8434972d75b72945db8af13f 100644 (file)
@@ -1,3 +1,7 @@
+2019-11-10  Jan Hubicka  <hubicka@ucw.cz>
+
+       * cgraph.c (cgraph_edge::maybe_hot_p): Do not use sreal_frequency.
+
 2019-11-10  Jan Hubicka  <hubicka@ucw.cz>
 
        * ipa-prop.c (ipa_propagate_indirect_call_infos): Remove ipa edge
index 96f1261f0ccb7a80d14369f2131284e6b9fffb98..aa54e955c76c4958b73f29628610ab65b87bfcaf 100644 (file)
@@ -2697,14 +2697,18 @@ cgraph_edge::maybe_hot_p (void)
     return false;
   if (caller->frequency == NODE_FREQUENCY_HOT)
     return true;
-  /* If profile is now known yet, be conservative.
-     FIXME: this predicate is used by early inliner and can do better there.  */
-  if (symtab->state < IPA_SSA)
+  if (!count.initialized_p ())
     return true;
-  if (caller->frequency == NODE_FREQUENCY_EXECUTED_ONCE
-      && sreal_frequency () * 2 < 3)
+  cgraph_node *where = caller->inlined_to ? caller->inlined_to : caller;
+  if (!where->count.initialized_p ())
     return false;
-  if (sreal_frequency () * PARAM_VALUE (HOT_BB_FREQUENCY_FRACTION) <= 1)
+  if (caller->frequency == NODE_FREQUENCY_EXECUTED_ONCE)
+    {
+      if (count.apply_scale (2, 1) < where->count.apply_scale (3, 1))
+       return false;
+    }
+  else if (count.apply_scale (PARAM_VALUE (HOT_BB_FREQUENCY_FRACTION), 1)
+          < where->count)
     return false;
   return true;
 }