Commit f36180f4 by Jan Hubicka Committed by Jan Hubicka

predict.c (determine_unlikely_bbs): Handle correctly BBs which appears in the queue multiple times.

	* predict.c (determine_unlikely_bbs): Handle correctly BBs
	which appears in the queue multiple times.

From-SVN: r256648
parent 39f309ac
2018-01-13 Jan Hubicka <hubicka@ucw.cz>
* predict.c (determine_unlikely_bbs): Handle correctly BBs
which appears in the queue multiple times.
2018-01-13 Richard Sandiford <richard.sandiford@linaro.org> 2018-01-13 Richard Sandiford <richard.sandiford@linaro.org>
Alan Hayward <alan.hayward@arm.com> Alan Hayward <alan.hayward@arm.com>
David Sherwood <david.sherwood@arm.com> David Sherwood <david.sherwood@arm.com>
......
...@@ -3565,6 +3565,8 @@ determine_unlikely_bbs () ...@@ -3565,6 +3565,8 @@ determine_unlikely_bbs ()
while (worklist.length () > 0) while (worklist.length () > 0)
{ {
bb = worklist.pop (); bb = worklist.pop ();
if (bb->count == profile_count::zero ())
continue;
if (bb != ENTRY_BLOCK_PTR_FOR_FN (cfun)) if (bb != ENTRY_BLOCK_PTR_FOR_FN (cfun))
{ {
bool found = false; bool found = false;
...@@ -3583,8 +3585,7 @@ determine_unlikely_bbs () ...@@ -3583,8 +3585,7 @@ determine_unlikely_bbs ()
if (found) if (found)
continue; continue;
} }
if (!(bb->count == profile_count::zero ()) if (dump_file && (dump_flags & TDF_DETAILS))
&& (dump_file && (dump_flags & TDF_DETAILS)))
fprintf (dump_file, fprintf (dump_file,
"Basic block %i is marked unlikely by backward prop\n", "Basic block %i is marked unlikely by backward prop\n",
bb->index); bb->index);
...@@ -3594,6 +3595,7 @@ determine_unlikely_bbs () ...@@ -3594,6 +3595,7 @@ determine_unlikely_bbs ()
{ {
if (!(e->src->count == profile_count::zero ())) if (!(e->src->count == profile_count::zero ()))
{ {
gcc_checking_assert (nsuccs[e->src->index] > 0);
nsuccs[e->src->index]--; nsuccs[e->src->index]--;
if (!nsuccs[e->src->index]) if (!nsuccs[e->src->index])
worklist.safe_push (e->src); worklist.safe_push (e->src);
......
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