Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(1068)

Issue 4802070: [google] New linker plugin to do function reordering in the final binary using callgraph profiles

Can't Edit
Can't Publish+Mail
Start Review
Created:
12 years, 8 months ago by Sriraman
Modified:
12 years, 8 months ago
Reviewers:
davidxl
CC:
gcc-patches_gcc.gnu.org
Base URL:
svn+ssh://gcc.gnu.org/svn/gcc/branches/google/gcc-4_6/
Visibility:
Public.

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+28635 lines, -9 lines) Patch
M Makefile.def View 3 chunks +5 lines, -1 line 0 comments Download
M Makefile.in View 35 chunks +1000 lines, -6 lines 0 comments Download
M configure View 2 chunks +5 lines, -0 lines 0 comments Download
M configure.ac View 2 chunks +5 lines, -0 lines 0 comments Download
A function_reordering_plugin/Makefile.am View 1 chunk +30 lines, -0 lines 0 comments Download
A function_reordering_plugin/Makefile.in View 1 chunk +534 lines, -0 lines 0 comments Download
A function_reordering_plugin/aclocal.m4 View 1 chunk +9024 lines, -0 lines 0 comments Download
A function_reordering_plugin/callgraph.h View 1 chunk +252 lines, -0 lines 0 comments Download
A function_reordering_plugin/callgraph.cc View 1 chunk +392 lines, -0 lines 0 comments Download
A function_reordering_plugin/config.h.in View 1 chunk +71 lines, -0 lines 0 comments Download
A function_reordering_plugin/configure View 1 chunk +16998 lines, -0 lines 0 comments Download
A function_reordering_plugin/configure.ac View 1 chunk +14 lines, -0 lines 0 comments Download
A function_reordering_plugin/function_reordering_plugin.cc View 1 chunk +218 lines, -0 lines 0 comments Download
M include/plugin-api.h View 6 chunks +87 lines, -2 lines 0 comments Download

Messages

Total messages: 3
Sriraman
This patch adds a new linker plugin to re-order functions. The plugin constructs an annotated ...
12 years, 8 months ago (2011-08-03 03:26:56 UTC) #1
Sriraman
Hi, This patch adds a new linker plugin to re-order functions. The plugin constructs an ...
12 years, 8 months ago (2011-08-03 03:36:52 UTC) #2
davidxl
12 years, 8 months ago (2011-08-03 04:51:05 UTC) #3
Ok for google branches

It is better to have a higher level compiler option to be introduced
for this purpose instead of asking user to specify the plugin path.
The option should enable 1) ffunction-sections; 2) cgraph note section
genration; 3) enable the plugin.  One possibility is to enhance the
-freorder-functions option for this:

-freorder-functions=hotness:affinity:.... the suboptions can be used
to specify layout algorithm used.

Can be done as follow ups.

David

On 2011/08/03 03:36:52, Sriraman wrote:
> Hi,
> 
>   This patch adds a new linker plugin to re-order functions.  The
> plugin constructs an annotated callgraph with edge profile information
> and then repeatedly groups sections that are connected by  hot edges
> and passes the new function layout to the linker.  The grouping is
> done similar to the Pettis Hansen code ordering scheme.
> 
> How to use the plugin:
> 
> During Profile use build stage of Feedback-directed builds, use the flags:
> -fcallgraph-profiles-sections
>
-Wl,--plugin,<gcc_install_dir>/libexec/gcc/x86_64-unknown-linux-gnu/4.6.x-google/libfunction_reordering_plugin.so
> 
> The first flag generates special .note.callgraph.text sections which
> contain the callgraph profiles that are read by the plugin and an new
> function layout is generated. The ordering of sections is dumped in
> file final_layout.txt.
> 
> The plugin itself is implemented in the three files:
> function_ordering_plugin.cc, callgraph.cc, and callgraph.h. The file
> include/plugin-api.h has changes which has already been submitted to
> trunk. The rest is related to Makefiles and configure scripts to build
> and install the plugin.
> 
>  Please find the patch here: http://codereview.appspot.com/4802070/
> 
> Thanks,
> -Sriraman.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b