predict.c (unlikely_executed_edge_p): Move ahead.
authorJan Hubicka <hubicka@ucw.cz>
Thu, 8 Jun 2017 16:41:35 +0000 (18:41 +0200)
committerJan Hubicka <hubicka@gcc.gnu.org>
Thu, 8 Jun 2017 16:41:35 +0000 (16:41 +0000)
* predict.c (unlikely_executed_edge_p): Move ahead.
(probably_never_executed_edge_p): Use it.

From-SVN: r249025

gcc/ChangeLog
gcc/predict.c

index 5b8d35ece2bc0c157c44f9ccf88b866b90c2d32c..697ed16728c76f6b38f2e19f288d519c4ef4c929 100644 (file)
@@ -1,3 +1,8 @@
+2017-06-08  Jan Hubicka  <hubicka@ucw.cz>
+
+       * predict.c (unlikely_executed_edge_p): Move ahead.
+       (probably_never_executed_edge_p): Use it.
+
 2017-06-08  Alexander Ivchenko  <alexander.ivchenko@intel.com>
 
        PR middle-end/79988
index b460a6f26ee6e024ea188d2c9532745283c514d5..bf932305cc9ea9d9eb478af4aa49c3d8c4b6009c 100644 (file)
@@ -238,11 +238,22 @@ probably_never_executed_bb_p (struct function *fun, const_basic_block bb)
 }
 
 
+/* Return true if E is unlikely executed for obvious reasons.  */
+
+static bool
+unlikely_executed_edge_p (edge e)
+{
+  return e->count == profile_count::zero ()
+        || (e->flags & (EDGE_EH | EDGE_FAKE));
+}
+
 /* Return true in case edge E is probably never executed.  */
 
 bool
 probably_never_executed_edge_p (struct function *fun, edge e)
 {
+  if (e->count.initialized_p ())
+    unlikely_executed_edge_p (e);
   return probably_never_executed (fun, e->count, EDGE_FREQUENCY (e));
 }
 
@@ -761,15 +772,6 @@ dump_prediction (FILE *file, enum br_predictor predictor, int probability,
   fprintf (file, "\n");
 }
 
-/* Return true if E is unlikely executed.  */
-
-static bool
-unlikely_executed_edge_p (edge e)
-{
-  return e->count == profile_count::zero ()
-        || (e->flags & (EDGE_EH | EDGE_FAKE));
-}
-
 /* Return true if STMT is known to be unlikely executed.  */
 
 static bool