tree-ssa-phiopt.c (replace_phi_edge_with_variable): Update profile.

* tree-ssa-phiopt.c (replace_phi_edge_with_variable): Update profile.
	* cfg.c (update_bb_profile_for_threading): Fix rescaling.

From-SVN: r101322
This commit is contained in:
Jan Hubicka 2005-06-25 13:59:55 +02:00 committed by Jan Hubicka
parent 5d9f607b1b
commit afc970a415
3 changed files with 8 additions and 1 deletions

View File

@ -1,5 +1,8 @@
2005-06-25 Jan Hubicka <jh@suse.cz>
* tree-ssa-phiopt.c (replace_phi_edge_with_variable): Update profile.
* cfg.c (update_bb_profile_for_threading): Fix rescaling.
* passes.c (rest_of_handle_branch_prob): Do not rebuild profiling info
when not neecesary
(rest_of_compilation): Fix conditional on branch prob pass.

View File

@ -901,7 +901,7 @@ update_bb_profile_for_threading (basic_block bb, int edge_frequency,
int scale = 65536 * REG_BR_PROB_BASE / prob;
FOR_EACH_EDGE (c, ei, bb->succs)
c->probability *= scale / 65536;
c->probability = (c->probability * scale) / 65536;
}
gcc_assert (bb == taken_edge->src);

View File

@ -331,6 +331,8 @@ replace_phi_edge_with_variable (basic_block cond_block,
{
EDGE_SUCC (cond_block, 0)->flags |= EDGE_FALLTHRU;
EDGE_SUCC (cond_block, 0)->flags &= ~(EDGE_TRUE_VALUE | EDGE_FALSE_VALUE);
EDGE_SUCC (cond_block, 0)->probability = REG_BR_PROB_BASE;
EDGE_SUCC (cond_block, 0)->count += EDGE_SUCC (cond_block, 1)->count;
block_to_remove = EDGE_SUCC (cond_block, 1)->dest;
}
@ -339,6 +341,8 @@ replace_phi_edge_with_variable (basic_block cond_block,
EDGE_SUCC (cond_block, 1)->flags |= EDGE_FALLTHRU;
EDGE_SUCC (cond_block, 1)->flags
&= ~(EDGE_TRUE_VALUE | EDGE_FALSE_VALUE);
EDGE_SUCC (cond_block, 1)->probability = REG_BR_PROB_BASE;
EDGE_SUCC (cond_block, 1)->count += EDGE_SUCC (cond_block, 0)->count;
block_to_remove = EDGE_SUCC (cond_block, 0)->dest;
}