]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Fixes for AutoFDO tests
authorEugene Rozenfeld <erozen@microsoft.com>
Tue, 3 Aug 2021 00:12:04 +0000 (17:12 -0700)
committerEugene Rozenfeld <erozen@microsoft.com>
Tue, 3 Aug 2021 21:25:47 +0000 (14:25 -0700)
* Changed several tests to use -fdump-ipa-afdo-optimized instead of -fdump-ipa-afdo
in dg-options so that the expected output can be found

* Increased the number of iterations in several tests so that perf can have
enough sampling events

Contributes to fixing PR gcov-profile/71672.

gcc/testsuite/ChangeLog:

* g++.dg/tree-prof/indir-call-prof.C: Fix options, increase the number of iterations.
* g++.dg/tree-prof/morefunc.C: Fix options, increase the number of iterations.
* g++.dg/tree-prof/reorder.C: Fix options, increase the number of iterations.
* gcc.dg/tree-prof/indir-call-prof-2.c: Fix options, increase the number of iterations.
* gcc.dg/tree-prof/indir-call-prof.c: Fix options.

gcc/testsuite/g++.dg/tree-prof/indir-call-prof.C
gcc/testsuite/g++.dg/tree-prof/morefunc.C
gcc/testsuite/g++.dg/tree-prof/reorder.C
gcc/testsuite/gcc.dg/tree-prof/indir-call-prof-2.c
gcc/testsuite/gcc.dg/tree-prof/indir-call-prof.c

index 3374744613ea8feef72f80d45cd9fbaae7a107e4..b45417106d0f751cab5cff62cd0be6568cd303a2 100644 (file)
@@ -1,4 +1,4 @@
-/* { dg-options "-O2 -fdump-tree-optimized -fdump-ipa-profile-optimized -fdump-ipa-afdo" } */
+/* { dg-options "-O2 -fdump-tree-optimized -fdump-ipa-profile-optimized -fdump-ipa-afdo-optimized" } */
 
 struct A {
   A () {}
@@ -26,7 +26,7 @@ main (void)
 
   int i;
 
-  for (i = 0; i < 1000000; i++)
+  for (i = 0; i < 10000000; i++)
     {
       p = (A *)wrap ((void *)&a);
       p->AA ();
index 621d09aec5b337f7ebf91a09278f1e911b79dbcc..96e0073ca8f9b1b61f2bc073f0a733d66e1c025e 100644 (file)
@@ -1,4 +1,5 @@
-/* { dg-options "-O2 -fno-devirtualize --param=profile-func-internal-id=0 -fdump-ipa-profile-optimized -fdump-ipa-afdo -Wno-attributes -Wno-coverage-mismatch -Wno-missing-profile" } */
+/* { dg-options "-O2 -fno-devirtualize --param=profile-func-internal-id=0 -fdump-ipa-profile-optimized -fdump-ipa-afdo-optimized -Wno-attributes -Wno-coverage-mismatch -Wno-missing-profile" } */
+
 #include "reorder_class1.h"
 #include "reorder_class2.h"
 
@@ -19,7 +20,7 @@ static __attribute__((always_inline))
 void test1 (A *tc)
 {
   int i;
-  for (i = 0; i < 1000; i++)
+  for (i = 0; i < 10000000; i++)
      g += tc->foo(); 
    if (g<100) g++;
 }
@@ -28,7 +29,7 @@ static __attribute__((always_inline))
 void test2 (B *tc)
 {
   int i;
-  for (i = 0; i < 1000000; i++)
+  for (i = 0; i < 10000000; i++)
      g += tc->foo();
 }
 
index 000fb651a692ec784380c679e79bcd4546527dc1..504909633698834ea5e20460c83ff775339ca4cd 100644 (file)
@@ -1,4 +1,4 @@
-/* { dg-options "-O2 -fno-devirtualize --param=profile-func-internal-id=0 -fdump-ipa-profile-optimized -fdump-ipa-afdo -Wno-coverage-mismatch -Wno-attributes" } */
+/* { dg-options "-O2 -fno-devirtualize --param=profile-func-internal-id=0 -fdump-ipa-profile-optimized -fdump-ipa-afdo-optimized -Wno-coverage-mismatch -Wno-attributes" } */
 
 #ifdef _PROFILE_USE
 #include "reorder_class1.h"
@@ -13,7 +13,7 @@ static __attribute__((always_inline))
 void test1 (A *tc)
 {
   int i;
-  for (i = 0; i < 1000000; i++)
+  for (i = 0; i < 10000000; i++)
      g += tc->foo(); 
    if (g<100) g++;
 }
@@ -22,7 +22,7 @@ static __attribute__((always_inline))
 void test2 (B *tc)
 {
   int i;
-  for (i = 0; i < 1000000; i++)
+  for (i = 0; i < 10000000; i++)
      g += tc->foo();
 }
 
index bbba0521018b3a063f1a76b66233f70551c05344..258532654223ac2678c31472ab11f928e98995e9 100644 (file)
@@ -22,7 +22,7 @@ int
 main (void)
 {
   int i, val = 0;
-  for (i = 0; i < 100000; i++)
+  for (i = 0; i < 10000000; i++)
     {
       val = do_op (val, add1);
       val = do_op (val, sub1);
index 138b85a08d2a48f5c9b9363036528556fc0ebe55..702045239f3f383ccb652ba35d7a495e2dd6e334 100644 (file)
@@ -1,4 +1,4 @@
-/* { dg-options "-O2 -fdump-tree-optimized -fdump-ipa-profile-optimized -fdump-ipa-afdo" } */
+/* { dg-options "-O2 -fdump-tree-optimized -fdump-ipa-profile-optimized -fdump-ipa-afdo-optimized" } */
 
 static int a1 (void)
 {