Patchwork [GOOGLE] guard recording of autofdo annotation info in a flag

login
register
mail settings
Submitter Dehao Chen
Date March 21, 2014, 5:10 p.m.
Message ID <CAO2gOZXzw4ympJt6U4PhjDsjc4iWoZy-2AKg2JQvWPanQBF5bQ@mail.gmail.com>
Download mbox | patch
Permalink /patch/332686/
State New
Headers show

Comments

Dehao Chen - March 21, 2014, 5:10 p.m.
This patch guards autofdo annotation coverage recording with a flag.

Test on-going.

OK for google-4_8 if test passes?

Thanks,
Dehao

Patch

Index: gcc/auto-profile.c
===================================================================
--- gcc/auto-profile.c (revision 208753)
+++ gcc/auto-profile.c (working copy)
@@ -1634,7 +1634,8 @@  auto_profile (void)
       pop_cfun ();
     }

-  autofdo::afdo_source_profile->write_annotated_count ();
+  if (flag_auto_profile_record_coverage_in_elf)
+    autofdo::afdo_source_profile->write_annotated_count ();
   return 0;
 }

Index: gcc/common.opt
===================================================================
--- gcc/common.opt (revision 208753)
+++ gcc/common.opt (working copy)
@@ -946,6 +946,10 @@  fauto-profile-accurate
 Common Report Var(flag_auto_profile_accurate) Optimization
 Whether to assume the sample profile is accurate.

+fauto-profile-record-coverage-in-elf
+Common Report Var(flag_auto_profile_record_coverage_in_elf) Optimization
+Whether to record annotation coverage info in elf.
+
 ; -fcheck-bounds causes gcc to generate array bounds checks.
 ; For C, C++ and ObjC: defaults off.
 ; For Java: defaults to on.