Skip to content

Commit 768f00e

Browse files
author
Jan Hubicka
committed
Fix some profile consistency testcases
Information about profile mismatches is printed only with -details-blocks for some time. I think it should be printed even with default to make it easier to spot when someone introduces new transform that breaks the profile, but I will send separate RFC for that. This patch enables details in all testcases that greps for Invalid sum. There are 4 testcases which fails: gcc.dg/tree-ssa/loop-ch-profile-1.c here the problem is that loop header dulication introduces loop invariant conditoinal that is later updated by tree-ssa-dom but dom does not take care of updating profile. Since loop-ch knows when it duplicates loop invariant, we may be able to get this right. The test is still useful since it tests that right after ch profile is consistent. gcc.dg/tree-prof/update-cunroll-2.c This is about profile updating code in duplicate_loop_body_to_header_edge being wrong when optimized out exit is not last in the loop. In that case the probability of later exits needs to be accounted in. I will think about making this better - in general this does not seem to have easy solution, but for special case of chained tests we can definitely account for the later exits. gcc.dg/tree-ssa/update-unroll-1.c This fails after aprefetch invoked unrolling. I did not look into details yet. gcc.dg/tree-prof/update-unroll-2.c This one seems similar as previous I decided to xfail these tests and deal with them incrementally and filled in PR110590. gcc/testsuite/ChangeLog: * g++.dg/tree-prof/indir-call-prof.C: Add block-details to dump flags. * gcc.dg/pr43864-2.c: Likewise. * gcc.dg/pr43864-3.c: Likewise. * gcc.dg/pr43864-4.c: Likewise. * gcc.dg/pr43864.c: Likewise. * gcc.dg/tree-prof/cold_partition_label.c: Likewise. * gcc.dg/tree-prof/indir-call-prof.c: Likewise. * gcc.dg/tree-prof/update-cunroll-2.c: Likewise. * gcc.dg/tree-prof/update-tailcall.c: Likewise. * gcc.dg/tree-prof/val-prof-1.c: Likewise. * gcc.dg/tree-prof/val-prof-2.c: Likewise. * gcc.dg/tree-prof/val-prof-3.c: Likewise. * gcc.dg/tree-prof/val-prof-4.c: Likewise. * gcc.dg/tree-prof/val-prof-5.c: Likewise. * gcc.dg/tree-ssa/fnsplit-1.c: Likewise. * gcc.dg/tree-ssa/loop-ch-profile-2.c: Likewise. * gcc.dg/tree-ssa/update-threading.c: Likewise. * gcc.dg/tree-ssa/update-unswitch-1.c: Likewise. * gcc.dg/unroll-7.c: Likewise. * gcc.dg/unroll-8.c: Likewise. * gfortran.dg/pr25623-2.f90: Likewise. * gfortran.dg/pr25623.f90: Likewise. * gcc.dg/tree-ssa/loop-ch-profile-1.c: Likewise; xfail. * gcc.dg/tree-ssa/update-cunroll.c: Likewise; xfail. * gcc.dg/tree-ssa/update-unroll-1.c: Likewise; xfail.
1 parent 5966349 commit 768f00e

25 files changed

+33
-29
lines changed

gcc/testsuite/g++.dg/tree-prof/indir-call-prof.C

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* { dg-options "-O2 -fdump-tree-optimized -fdump-ipa-profile-optimized -fdump-ipa-afdo-optimized" } */
1+
/* { dg-options "-O2 -fdump-tree-optimized-blocks-details -fdump-ipa-profile-optimized -fdump-ipa-afdo-optimized" } */
22

33
struct A {
44
A () {}

gcc/testsuite/gcc.dg/pr43864-2.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* { dg-do compile } */
2-
/* { dg-options "-O2 -ftree-tail-merge -fdump-tree-pre" } */
2+
/* { dg-options "-O2 -ftree-tail-merge -fdump-tree-pre-details-blocks" } */
33

44
int
55
f (int c, int b, int d)

gcc/testsuite/gcc.dg/pr43864-3.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* { dg-do compile } */
2-
/* { dg-options "-O2 -ftree-tail-merge -fdump-tree-pre" } */
2+
/* { dg-options "-O2 -fdump-tree-pre-blocks-details" } */
33

44
/* Commutative case. */
55

gcc/testsuite/gcc.dg/pr43864-4.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* { dg-do compile } */
2-
/* { dg-options "-O2 -ftree-tail-merge -fdump-tree-pre" } */
2+
/* { dg-options "-O2 -ftree-tail-merge -fdump-tree-pre-details-blocks" } */
33

44
/* Different stmt order. */
55

gcc/testsuite/gcc.dg/pr43864.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* { dg-do compile } */
2-
/* { dg-options "-O2 -ftree-tail-merge -fdump-tree-pre" } */
2+
/* { dg-options "-O2 -fdump-tree-pre-details-blocks" } */
33

44
extern void foo (char*, int);
55
extern void mysprintf (char *, char *);

gcc/testsuite/gcc.dg/tree-prof/cold_partition_label.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/* Test case to check if function foo gets split and the cold function
22
gets a label. */
33
/* { dg-require-effective-target freorder } */
4-
/* { dg-options "-O2 -freorder-blocks-and-partition -save-temps -fdump-tree-optimized" } */
4+
/* { dg-options "-O2 -freorder-blocks-and-partition -save-temps -fdump-tree-optimized-details-blocks" } */
55

66
#ifdef FOR_AUTOFDO_TESTING
77
#define MAXITER 1000000

gcc/testsuite/gcc.dg/tree-prof/indir-call-prof.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* { dg-options "-O2 -fdump-tree-optimized -fdump-ipa-profile-optimized -fdump-ipa-afdo-optimized" } */
1+
/* { dg-options "-O2 -fdump-tree-optimized-details-blocks -fdump-ipa-profile-optimized -fdump-ipa-afdo-optimized" } */
22

33
static int a1 (void)
44
{

gcc/testsuite/gcc.dg/tree-prof/update-cunroll-2.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
/* { dg-options "-O2 -fdump-tree-optimized-blocks" } */
2+
/* { dg-options "-O2 -fdump-tree-optimized-details-blocks" } */
33
int a[8];
44
__attribute__ ((noinline))
55
int t()
@@ -18,4 +18,4 @@ main ()
1818
t ();
1919
return 0;
2020
}
21-
/* { dg-final-use { scan-tree-dump-not "Invalid sum" "optimized"} } */
21+
/* { dg-final-use { scan-tree-dump-not "Invalid sum" "optimized" {xfail *-*-*} } } */

gcc/testsuite/gcc.dg/tree-prof/update-tailcall.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* { dg-options "-O2 -fdump-tree-tailc -fdump-tree-optimized" } */
1+
/* { dg-options "-O2 -fdump-tree-tailc-details-blocks -fdump-tree-optimized-details-blocks" } */
22
__attribute__ ((noinline))
33
int factorial(int x)
44
{

gcc/testsuite/gcc.dg/tree-prof/val-prof-1.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* { dg-options "-O2 -fdump-tree-optimized -fdump-ipa-profile-optimized" } */
1+
/* { dg-options "-O2 -fdump-tree-optimized-details-blocks -fdump-ipa-profile-optimized" } */
22
int a[1000];
33
int b = 256;
44
int c = 257;

0 commit comments

Comments
 (0)