tree-cfg.c (gimple_merge_blocks): Updates bb count with max count.

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

	* tree-cfg.c (gimple_merge_blocks): Updates bb count with max count.

From-SVN: r210538
This commit is contained in:
Dehao Chen 2014-05-16 23:16:13 +00:00 committed by Dehao Chen
parent b200de021c
commit 2f6eed01c3
2 changed files with 10 additions and 0 deletions

View File

@ -1,3 +1,7 @@
2014-05-16 Dehao Chen <dehao@google.com>
* tree-cfg.c (gimple_merge_blocks): Updates bb count with max count.
2014-05-16 Oleg Endo <olegendo@gcc.gnu.org> 2014-05-16 Oleg Endo <olegendo@gcc.gnu.org>
PR target/54089 PR target/54089

View File

@ -1877,6 +1877,12 @@ gimple_merge_blocks (basic_block a, basic_block b)
} }
} }
/* When merging two BBs, if their counts are different, the larger count
is selected as the new bb count. This is to handle inconsistent
profiles. */
a->count = MAX (a->count, b->count);
a->frequency = MAX (a->frequency, b->frequency);
/* Merge the sequences. */ /* Merge the sequences. */
last = gsi_last_bb (a); last = gsi_last_bb (a);
gsi_insert_seq_after (&last, bb_seq (b), GSI_NEW_STMT); gsi_insert_seq_after (&last, bb_seq (b), GSI_NEW_STMT);