From 5591f0dd96af5ed9e0de9fcf4dee0c62c7089b57 Mon Sep 17 00:00:00 2001 From: Jan Hubicka Date: Thu, 8 Jun 2017 18:41:35 +0200 Subject: [PATCH] predict.c (unlikely_executed_edge_p): Move ahead. * predict.c (unlikely_executed_edge_p): Move ahead. (probably_never_executed_edge_p): Use it. From-SVN: r249025 --- gcc/ChangeLog | 5 +++++ gcc/predict.c | 20 +++++++++++--------- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 5b8d35ece2b..697ed16728c 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2017-06-08 Jan Hubicka + + * predict.c (unlikely_executed_edge_p): Move ahead. + (probably_never_executed_edge_p): Use it. + 2017-06-08 Alexander Ivchenko PR middle-end/79988 diff --git a/gcc/predict.c b/gcc/predict.c index b460a6f26ee..bf932305cc9 100644 --- a/gcc/predict.c +++ b/gcc/predict.c @@ -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 -- 2.30.2