tree-ssa-tail-merge.c (replace_block_by): Update edge weights during merging.

2013-10-18  Teresa Johnson  <tejohnson@google.com>

	* tree-ssa-tail-merge.c (replace_block_by): Update edge
	weights during merging.

From-SVN: r203823
This commit is contained in:
Teresa Johnson 2013-10-18 14:36:53 +00:00 committed by Teresa Johnson
parent 4db45577b7
commit adc7a8127a
2 changed files with 19 additions and 0 deletions

View File

@ -1,3 +1,8 @@
2013-10-18 Teresa Johnson <tejohnson@google.com>
* tree-ssa-tail-merge.c (replace_block_by): Update edge
weights during merging.
2013-10-18 Andrew MacLeod <amacleod@redhat.com>
* tree-cfg.h: Rename from tree-flow.h. Remove #includes.

View File

@ -1462,6 +1462,8 @@ static void
replace_block_by (basic_block bb1, basic_block bb2)
{
edge pred_edge;
edge e1;
edge_iterator ei;
unsigned int i;
gimple bb2_phi;
@ -1494,6 +1496,18 @@ replace_block_by (basic_block bb1, basic_block bb2)
bb2->count += bb1->count;
/* Merge the outgoing edge counts from bb1 onto bb2. */
FOR_EACH_EDGE (e1, ei, bb1->succs)
{
edge e2;
e2 = find_edge (bb2, e1->dest);
gcc_assert (e2);
e2->count += e1->count;
/* Recompute the probability from the new merged edge count (bb2->count
was updated above). */
e2->probability = GCOV_COMPUTE_SCALE (e2->count, bb2->count);
}
/* Do updates that use bb1, before deleting bb1. */
release_last_vdef (bb1);
same_succ_flush_bb (bb1);