Commit 5591f0dd by Jan Hubicka Committed by Jan Hubicka

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
parent dadcc51c
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> 2017-06-08 Alexander Ivchenko <alexander.ivchenko@intel.com>
PR middle-end/79988 PR middle-end/79988
......
...@@ -238,11 +238,22 @@ probably_never_executed_bb_p (struct function *fun, const_basic_block bb) ...@@ -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. */ /* Return true in case edge E is probably never executed. */
bool bool
probably_never_executed_edge_p (struct function *fun, edge e) 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)); return probably_never_executed (fun, e->count, EDGE_FREQUENCY (e));
} }
...@@ -761,15 +772,6 @@ dump_prediction (FILE *file, enum br_predictor predictor, int probability, ...@@ -761,15 +772,6 @@ dump_prediction (FILE *file, enum br_predictor predictor, int probability,
fprintf (file, "\n"); 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. */ /* Return true if STMT is known to be unlikely executed. */
static bool static bool
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment