Commit 47e78f98 by Dehao Chen Committed by Dehao Chen

tree-cfg.c (gimple_merge_blocks): Only reset count when BBs are in the same loop.

2014-06-03  Dehao Chen  <dehao@google.com>

	* tree-cfg.c (gimple_merge_blocks): Only reset count when BBs are in
	the same loop.
	* gcc.dg/tree-prof/merge_block.c: New test.

From-SVN: r211202
parent eb7404d4
2014-06-03 Dehao Chen <dehao@google.com>
* tree-cfg.c (gimple_merge_blocks): Only reset count when BBs are in
the same loop.
2014-06-03 Marek Polacek <polacek@redhat.com> 2014-06-03 Marek Polacek <polacek@redhat.com>
PR c/60439 PR c/60439
......
2014-06-03 Dehao Chen <dehao@google.com>
* gcc.dg/tree-prof/merge_block.c: New test.
2014-06-03 Uros Bizjak <ubizjak@gmail.com> 2014-06-03 Uros Bizjak <ubizjak@gmail.com>
* g++.dg/ext/mv14.C (dg-options): Add -march=x86-64. * g++.dg/ext/mv14.C (dg-options): Add -march=x86-64.
......
/* { dg-options "-O2 -fno-ipa-pure-const -fdump-tree-optimized-blocks-details -fno-early-inlining" } */
int a[8];
int t()
{
int i;
for (i = 0; i < 3; i++)
if (a[i])
break;
return i;
}
main ()
{
int i;
/* The loop will be optimized away after ipa-inline. */
for (i = 0; i < 1000; i++)
t ();
return 0;
}
/* { dg-final-use { scan-tree-dump-not "Invalid sum" "optimized"} } */
/* { dg-final-use { cleanup-tree-dump "optimized" } } */
...@@ -1880,8 +1880,11 @@ gimple_merge_blocks (basic_block a, basic_block b) ...@@ -1880,8 +1880,11 @@ gimple_merge_blocks (basic_block a, basic_block b)
/* When merging two BBs, if their counts are different, the larger count /* When merging two BBs, if their counts are different, the larger count
is selected as the new bb count. This is to handle inconsistent is selected as the new bb count. This is to handle inconsistent
profiles. */ profiles. */
a->count = MAX (a->count, b->count); if (a->loop_father == b->loop_father)
a->frequency = MAX (a->frequency, b->frequency); {
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);
......
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