Patchwork [GOOGLE] Fix the LIPO support in AutoFDO

login
register
mail settings
Submitter Dehao Chen
Date April 18, 2013, 9:12 p.m.
Message ID <CAO2gOZVCALLYt2r982qG-X9MRFrNP546wiw07M2cycF-vwkF4Q@mail.gmail.com>
Download mbox | patch
Permalink /patch/237739/
State New
Headers show

Comments

Dehao Chen - April 18, 2013, 9:12 p.m.
This patch fixes LIPO support in AutoFDO.

Bootstrapped and passed regression tests.

OK for google-4_7 branch?

Thanks,
Dehao

Patch

Index: gcc/coverage.c
===================================================================
--- gcc/coverage.c (revision 198056)
+++ gcc/coverage.c (working copy)
@@ -2857,7 +2857,7 @@  coverage_init (const char *filename, const char* s
       strcat (main_input_file_name, source_name);
     }

-  if (flag_branch_probabilities)
+  if (flag_branch_probabilities && !flag_auto_profile)
     read_counts_file (da_file_name, 0);

   /* Reads at most one auxiliary GCDA file since we don't support merging */
Index: gcc/auto-profile.c
===================================================================
--- gcc/auto-profile.c (revision 198057)
+++ gcc/auto-profile.c (working copy)
@@ -1850,6 +1850,13 @@  auto_profile (void)
       pop_cfun ();
     }

+  cgraph_pre_profiling_inlining_done = true;
+  cgraph_process_module_scope_statics ();
+  /* Now perform link to allow cross module inlining.  */
+  cgraph_do_link ();
+  varpool_do_link ();
+  cgraph_unify_type_alias_sets ();
+
   return TODO_rebuild_cgraph_edges;
 }