Commit b829f3fa by Jan Hubicka Committed by Jan Hubicka

tree-ssa-dce.c (remove_dead_stmt): Update profile.

	* tree-ssa-dce.c (remove_dead_stmt): Update profile.
	* tree-split_edge.c (tree_split_edge): Likewise.
	(thread_jumps): Likewise.

From-SVN: r87284
parent 229031d0
2004-09-10 Jan Hubicka <jh@suse.cz>
* tree-ssa-dce.c (remove_dead_stmt): Update profile.
* tree-split_edge.c (tree_split_edge): Likewise.
(thread_jumps): Likewise.
2004-09-10 Kazu Hirata <kazu@cs.umass.edu> 2004-09-10 Kazu Hirata <kazu@cs.umass.edu>
* cgraphunit.c, predict.c, tree-ssa-loop-ivopts.c: Fix comment * cgraphunit.c, predict.c, tree-ssa-loop-ivopts.c: Fix comment
......
...@@ -3018,7 +3018,11 @@ tree_split_edge (edge edge_in) ...@@ -3018,7 +3018,11 @@ tree_split_edge (edge edge_in)
after_bb = edge_in->src; after_bb = edge_in->src;
new_bb = create_empty_bb (after_bb); new_bb = create_empty_bb (after_bb);
new_bb->frequency = EDGE_FREQUENCY (edge_in);
new_bb->count = edge_in->count;
new_edge = make_edge (new_bb, dest, EDGE_FALLTHRU); new_edge = make_edge (new_bb, dest, EDGE_FALLTHRU);
new_edge->probability = REG_BR_PROB_BASE;
new_edge->count = edge_in->count;
/* Find all the PHI arguments on the original edge, and change them to /* Find all the PHI arguments on the original edge, and change them to
the new edge. Do it before redirection, so that the argument does not the new edge. Do it before redirection, so that the argument does not
...@@ -3852,6 +3856,8 @@ thread_jumps (void) ...@@ -3852,6 +3856,8 @@ thread_jumps (void)
forwardable. */ forwardable. */
for (e = bb->succ; e; e = next) for (e = bb->succ; e; e = next)
{ {
int freq;
gcov_type count;
next = e->succ_next; next = e->succ_next;
/* If the edge is abnormal or its destination is not /* If the edge is abnormal or its destination is not
...@@ -3860,6 +3866,9 @@ thread_jumps (void) ...@@ -3860,6 +3866,9 @@ thread_jumps (void)
|| !tree_forwarder_block_p (e->dest)) || !tree_forwarder_block_p (e->dest))
continue; continue;
count = e->count;
freq = EDGE_FREQUENCY (e);
/* Now walk through as many forwarder block as possible to /* Now walk through as many forwarder block as possible to
find the ultimate destination we want to thread our jump find the ultimate destination we want to thread our jump
to. */ to. */
...@@ -3879,6 +3888,15 @@ thread_jumps (void) ...@@ -3879,6 +3888,15 @@ thread_jumps (void)
break; break;
bb_ann (dest)->forwardable = 0; bb_ann (dest)->forwardable = 0;
dest->frequency -= freq;
if (dest->frequency < 0)
dest->frequency = 0;
dest->count -= count;
if (dest->count < 0)
dest->count = 0;
dest->succ->count -= count;
if (dest->succ->count < 0)
dest->succ->count = 0;
} }
/* Reset the forwardable marks to 1. */ /* Reset the forwardable marks to 1. */
......
...@@ -739,6 +739,8 @@ remove_dead_stmt (block_stmt_iterator *i, basic_block bb) ...@@ -739,6 +739,8 @@ remove_dead_stmt (block_stmt_iterator *i, basic_block bb)
/* Redirect the first edge out of BB to reach POST_DOM_BB. */ /* Redirect the first edge out of BB to reach POST_DOM_BB. */
redirect_edge_and_branch (bb->succ, post_dom_bb); redirect_edge_and_branch (bb->succ, post_dom_bb);
PENDING_STMT (bb->succ) = NULL; PENDING_STMT (bb->succ) = NULL;
bb->succ->probability = REG_BR_PROB_BASE;
bb->succ->count = bb->count;
/* The edge is no longer associated with a conditional, so it does /* The edge is no longer associated with a conditional, so it does
not have TRUE/FALSE flags. */ not have TRUE/FALSE flags. */
......
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