[google][4.7]Port function reordering via linker plugin from google/gcc-4_6 branch (issue6195099)
Sriraman Tallam
tmsriram@google.com
Thu May 17 01:56:00 GMT 2012
Patch too large to be attached, rejected by gcc-patches. Please see:
http://codereview.appspot.com/download/issue6195099_1.diff
Thanks,
-Sri.
On Wed, May 16, 2012 at 6:52 PM, Sriraman Tallam <tmsriram@google.com> wrote:
> Hi,
>
> This patch ports function reordering support into google/gcc-4_7 branch
> from google/gcc-4_6 branch. There are 3 parts which are combined:
>
> * Adding option -freoder-functions=callgraph.
> * Dumping callgraph profiles in separate sections.
> * The linker plugin itself.
>
> Port revisions from google/gcc-4_6
> r177289, r177308, r179104, r179289, r179303, r179404, r182447
>
> into google/gcc-4_7
>
> adding function reordering support via linker plugin invoked with option
> -freorder-functions=callgraph.
>
> Patch also can be reviewed here: http://codereview.appspot.com/6195099
>
> function_reordering_plugin:
>
> * config.h.in: Generate.
> * configure: Generate.
> * Makefile.in: New file.
> * configure.ac: New file.
> * callgraph.h: New file.
> * callgraph.c: New file.
> * function_reordering_plugin.c: New file.
> * Makefile.am: Generate.
> * aclocal.m4: Generate.
>
> gcc:
> * doc/invoke.texi: Document -freorder-functions=*
> * cgraphbuild.c (remove_cgraph_callee_edges): Preserve
> callgraph till pass_final.
> * configure: Regenerate.
> * final.c (dump_cgraph_profiles): New function.
> (rest_of_handle_final): Call dumping of cgraph profiles in
> .gnu.text.callgraph sections.
> * gcc.c (LINK_COMMAND_SPEC): Process -freorder-functions=
> (set_func_reorder_linker_plugin_spec): New function.
> (main): Call function reorder plugin.
> * testsuite/lib/target-supports-dg.exp
> (dg-require-section-exclude): New proc.
> (dg-require-linker-function-reordering-plugin): New proc.
> * testsuite/lib/target-supports.exp
> (check_section_exclude_available): New proc.
> (check_linker_function_reordering_plugin_supported): New proc.
> * testsuite/g++.dg/tree-prof/callgraph-profiles.C: New test.
> * config.in: undef FRPLUGINSONAME
> * opts.c
> * configure.ac (FRPLUGINSONAME): Define
> * common.opt (fcallgraph-profiles-sections): Remove.
> (freorder-functions=): New option.
> * tree-optimize.c (gate_all_optimizations): Mark last cleanup of
> callgraph.
> * config.host: Set function reordering plugin.
> * params.def (PARAM_NOTE_CGRAPH_SECTION_EDGE_THRESHOLD): Remove.
> (PARAM_GNU_CGRAPH_SECTION_EDGE_THRESHOLD): Add.
>
> toplevel:
> * Makefile.in: Regenerate.
> * Makefile.def: Build function reordering plugin.
> * configure.ac: Build function reordering plugin.
> * configure: Regenerate.
>
> Patch attached.
>
> Thanks,
> -Sri.
More information about the Gcc-patches
mailing list