public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r12-2709] Fix indir-call-prof-2.c with AutoFDO
@ 2021-08-03 21:38 Eugene Rozenfeld
  0 siblings, 0 replies; only message in thread
From: Eugene Rozenfeld @ 2021-08-03 21:38 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:0ed093c7c3f755bc1cd80e5186abeb2f5c50ee0c

commit r12-2709-g0ed093c7c3f755bc1cd80e5186abeb2f5c50ee0c
Author: Eugene Rozenfeld <erozen@microsoft.com>
Date:   Mon Aug 2 17:22:34 2021 -0700

    Fix indir-call-prof-2.c with AutoFDO
    
    indir-call-prof-2.c has -fno-early-inlining but AutoFDO can't work without
    early inlining (it needs to match the inlining of the profiled binary).
    I changed profopt.exp to always pass -fearly-inlining for AutoFDO.
    With that change the indirect call inlining in indir-call-prof-2.c happens in the early inliner
    so I changed the dg-final-use-autofdo.
    
    Contributes to fixing PR gcov-profile/71672
    
    gcc/testsuite/ChangeLog:
    
            * gcc.dg/tree-prof/indir-call-prof-2.c: Fix dg-final-use-autofdo.
            * lib/profopt.exp: Pass -fearly-inlining when compiling with AutoFDO.

Diff:
---
 gcc/testsuite/gcc.dg/tree-prof/indir-call-prof-2.c | 6 +++---
 gcc/testsuite/lib/profopt.exp                      | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/gcc/testsuite/gcc.dg/tree-prof/indir-call-prof-2.c b/gcc/testsuite/gcc.dg/tree-prof/indir-call-prof-2.c
index 25853265422..594c3f34d57 100644
--- a/gcc/testsuite/gcc.dg/tree-prof/indir-call-prof-2.c
+++ b/gcc/testsuite/gcc.dg/tree-prof/indir-call-prof-2.c
@@ -1,4 +1,4 @@
-/* { dg-options "-O2 -fno-early-inlining -fdump-ipa-profile-optimized -fdump-ipa-afdo" } */
+/* { dg-options "-O2 -fno-early-inlining -fdump-ipa-profile-optimized -fdump-tree-einline-optimized" } */
 volatile int one;
 static int
 add1 (int val)
@@ -31,5 +31,5 @@ main (void)
 }
 /* { dg-final-use-not-autofdo { scan-ipa-dump "Indirect call -> direct call.* add1 .will resolve by ipa-profile" "profile"} } */
 /* { dg-final-use-not-autofdo { scan-ipa-dump "Indirect call -> direct call.* sub1 .will resolve by ipa-profile" "profile"} } */
-/* { dg-final-use-autofdo { scan-ipa-dump "Indirect call -> direct call.* add1 .will resolve by ipa-profile" "afdo"} } */
-/* { dg-final-use-autofdo { scan-ipa-dump "Indirect call -> direct call.* sub1 .will resolve by ipa-profile" "afdo"} } */
+/* { dg-final-use-autofdo { scan-tree-dump "Inlining add1/1 into main/4." "einline"} } */
+/* { dg-final-use-autofdo { scan-tree-dump "Inlining sub1/2 into main/4." "einline"} } */
diff --git a/gcc/testsuite/lib/profopt.exp b/gcc/testsuite/lib/profopt.exp
index 9997eb3bb7e..030d25e52e5 100644
--- a/gcc/testsuite/lib/profopt.exp
+++ b/gcc/testsuite/lib/profopt.exp
@@ -290,7 +290,7 @@ proc auto-profopt-execute { src } {
     }
     set profile_wrapper [profopt-perf-wrapper]
     set profile_option "-g -DFOR_AUTOFDO_TESTING"
-    set feedback_option "-fauto-profile -DFOR_AUTOFDO_TESTING"
+    set feedback_option "-fauto-profile -DFOR_AUTOFDO_TESTING -fearly-inlining"
     set run_autofdo 1
     profopt-execute $src
     unset profile_wrapper


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-08-03 21:38 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-03 21:38 [gcc r12-2709] Fix indir-call-prof-2.c with AutoFDO Eugene Rozenfeld

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).