Commit b0e66512 by Dehao Chen Committed by Dehao Chen

cfghooks.c (make_forwarder_block): Use direct computation to get fall-through…

cfghooks.c (make_forwarder_block): Use direct computation to get fall-through edge's count and frequency.

2014-05-16  Dehao Chen  <dehao@google.com>

	* cfghooks.c (make_forwarder_block): Use direct computation to
	get fall-through edge's count and frequency.

From-SVN: r210528
parent 870c7fa0
2014-05-16 Dehao Chen <dehao@google.com>
* cfghooks.c (make_forwarder_block): Use direct computation to
get fall-through edge's count and frequency.
2014-02-07 Benno Schulenberg <bensberg@justemail.net>
* config/arc/arc.c (arc_init): Fix typo in error message.
......
......@@ -833,6 +833,9 @@ make_forwarder_block (basic_block bb, bool (*redirect_edge_p) (edge),
fallthru = split_block_after_labels (bb);
dummy = fallthru->src;
dummy->count = 0;
dummy->frequency = 0;
fallthru->count = 0;
bb = fallthru->dest;
/* Redirect back edges we want to keep. */
......@@ -842,20 +845,13 @@ make_forwarder_block (basic_block bb, bool (*redirect_edge_p) (edge),
if (redirect_edge_p (e))
{
dummy->frequency += EDGE_FREQUENCY (e);
dummy->count += e->count;
fallthru->count += e->count;
ei_next (&ei);
continue;
}
dummy->frequency -= EDGE_FREQUENCY (e);
dummy->count -= e->count;
if (dummy->frequency < 0)
dummy->frequency = 0;
if (dummy->count < 0)
dummy->count = 0;
fallthru->count -= e->count;
if (fallthru->count < 0)
fallthru->count = 0;
e_src = e->src;
jump = redirect_edge_and_branch_force (e, bb);
if (jump != NULL)
......
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