diff options
author | dehao <dehao@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-05-16 23:16:13 +0000 |
---|---|---|
committer | dehao <dehao@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-05-16 23:16:13 +0000 |
commit | 29e953a51ff5b24e1a7f950b4f929e212c8ab540 (patch) | |
tree | bade7ce8e39d8b581d19f011575ebb6e0a4f40d3 /gcc/tree-cfg.c | |
parent | 25cc20651df46911bbb21ed4cbe1226d8f7c3e61 (diff) | |
download | gcc-29e953a51ff5b24e1a7f950b4f929e212c8ab540.tar.gz |
2014-05-16 Dehao Chen <dehao@google.com>
* tree-cfg.c (gimple_merge_blocks): Updates bb count with max count.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@210538 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-cfg.c')
-rw-r--r-- | gcc/tree-cfg.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c index 9be04fe81b5..25e65e0ea38 100644 --- a/gcc/tree-cfg.c +++ b/gcc/tree-cfg.c @@ -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. */ last = gsi_last_bb (a); gsi_insert_seq_after (&last, bb_seq (b), GSI_NEW_STMT); |