]> git.ipfire.org Git - thirdparty/gcc.git/commit
Fix some profile consistency testcases
authorJan Hubicka <jh@suse.cz>
Fri, 7 Jul 2023 17:16:59 +0000 (19:16 +0200)
committerJan Hubicka <jh@suse.cz>
Fri, 7 Jul 2023 17:16:59 +0000 (19:16 +0200)
commit768f00e3e84123e8d0f1bf28a3b2e0b7995402f1
treebbf2dfebaf22648461e69a1eb6a3c7c736b8f5b5
parent5966349aa7e1fcbee2558f996b2484b433a0fcf4
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.
25 files changed:
gcc/testsuite/g++.dg/tree-prof/indir-call-prof.C
gcc/testsuite/gcc.dg/pr43864-2.c
gcc/testsuite/gcc.dg/pr43864-3.c
gcc/testsuite/gcc.dg/pr43864-4.c
gcc/testsuite/gcc.dg/pr43864.c
gcc/testsuite/gcc.dg/tree-prof/cold_partition_label.c
gcc/testsuite/gcc.dg/tree-prof/indir-call-prof.c
gcc/testsuite/gcc.dg/tree-prof/update-cunroll-2.c
gcc/testsuite/gcc.dg/tree-prof/update-tailcall.c
gcc/testsuite/gcc.dg/tree-prof/val-prof-1.c
gcc/testsuite/gcc.dg/tree-prof/val-prof-2.c
gcc/testsuite/gcc.dg/tree-prof/val-prof-3.c
gcc/testsuite/gcc.dg/tree-prof/val-prof-4.c
gcc/testsuite/gcc.dg/tree-prof/val-prof-5.c
gcc/testsuite/gcc.dg/tree-ssa/fnsplit-1.c
gcc/testsuite/gcc.dg/tree-ssa/loop-ch-profile-1.c
gcc/testsuite/gcc.dg/tree-ssa/loop-ch-profile-2.c
gcc/testsuite/gcc.dg/tree-ssa/update-cunroll.c
gcc/testsuite/gcc.dg/tree-ssa/update-threading.c
gcc/testsuite/gcc.dg/tree-ssa/update-unroll-1.c
gcc/testsuite/gcc.dg/tree-ssa/update-unswitch-1.c
gcc/testsuite/gcc.dg/unroll-7.c
gcc/testsuite/gcc.dg/unroll-8.c
gcc/testsuite/gfortran.dg/pr25623-2.f90
gcc/testsuite/gfortran.dg/pr25623.f90