Patchwork [wwwdocs] Mention function reordering

login
register
mail settings
Submitter Jan Hubicka
Date Jan. 7, 2011, 6:03 p.m.
Message ID <20110107180316.GH32433@kam.mff.cuni.cz>
Download mbox | patch
Permalink /patch/77896/
State New
Headers show

Comments

Jan Hubicka - Jan. 7, 2011, 6:03 p.m.
Hi,
this patch mention function reordering.  We probably should test if darwin
implementation is working and add Apple LD into list of well behaving linkers.

Honza
IainS - Jan. 7, 2011, 6:13 p.m.
On 7 Jan 2011, at 18:03, Jan Hubicka wrote:

> Hi,
> this patch mention function reordering.  We probably should test if  
> darwin
> implementation is working and add Apple LD into list of well  
> behaving linkers.

I committed the patches that enable reordering on Darwin today ...
... so it should be evident by the end of the weekend if there are any  
issues.

(ACAICT, the partitioning works on the versions I  can test - and we  
do not try to apply for Darwin < 9).

However, the other chaps test with different options & more add-ons ...

Iain

>
> Honza
>
> Index: changes.html
> ===================================================================
> RCS file: /cvs/gcc/wwwdocs/htdocs/gcc-4.6/changes.html,v
> retrieving revision 1.73
> diff -u -r1.73 changes.html
> --- changes.html	27 Nov 2010 10:26:28 -0000	1.73
> +++ changes.html	7 Jan 2011 17:59:35 -0000
> @@ -65,7 +65,7 @@
>            now split itself into multiple parallel compilations.  
> Parallelism
>            is controlled with <code>-flto=<em>n</em></code> (where
>            <em>n</em> specifies the number of compilations to  
> execute in
> -           parallel.  GCC can also cooperate with a GNU make job  
> server
> +           parallel).  GCC can also cooperate with a GNU make job  
> server
>            by specifying the <code>-flto=jobserver</code> option and
>            adding <code>+</code> to the beginning of the
>            Makefile rule executing the linker.</li>
> @@ -136,6 +136,19 @@
>             Unlikely executed functions are optimized for size.   
> Functions
>             executed once are optimized for size except for the inner
>             loops.</li>
> +	  <li>On most targets with named section support the functions  
> used only
> +	    at startup (static constructors and <code>main</code>),  
> functions used
> +	    only at exit and functions detected to be cold are placed into  
> separate
> +	    text segment subsections.
> +	    This extends <code>-freorder-functions</code> feature and is
> +	    controlled by the same switch. The goal is to improve startup  
> time of large
> +	    C++ programs.
> +	    <p>Proper function placement require linker support.
> +	    GNU ld 2.21.51 on ELF targets was updated to place
> +	    those functions together within the text section leading to  
> better code
> +	    locality and faster startup times of large C++ programs.  
> Support in gold
> +	    linker is planned.</p>
> +	    </li>
>       </ul>
>       </li>
>       <li>A new switch <code>-fstack-usage</code> has been added.   
> It makes
Ralf Wildenhues - Jan. 7, 2011, 6:18 p.m.
Hi Jan,

a couple of nits:

* Jan Hubicka wrote on Fri, Jan 07, 2011 at 07:03:16PM CET:
> --- changes.html	27 Nov 2010 10:26:28 -0000	1.73
> +++ changes.html	7 Jan 2011 17:59:35 -0000

> @@ -136,6 +136,19 @@
>              Unlikely executed functions are optimized for size.  Functions
>              executed once are optimized for size except for the inner
>              loops.</li>
> +	  <li>On most targets with named section support the functions used only

s/support the/support,/

> +	    at startup (static constructors and <code>main</code>), functions used
> +	    only at exit and functions detected to be cold are placed into separate
> +	    text segment subsections.
> +	    This extends <code>-freorder-functions</code> feature and is

s/extends/& the/

> +	    controlled by the same switch. The goal is to improve startup time of large

the startup time

> +	    C++ programs.
> +	    <p>Proper function placement require linker support.

requires

> +	    GNU ld 2.21.51 on ELF targets was updated to place
> +	    those functions together within the text section leading to better code
> +	    locality and faster startup times of large C++ programs. Support in gold

the gold linker

> +	    linker is planned.</p>
> +	    </li>
>        </ul>
>        </li>
>        <li>A new switch <code>-fstack-usage</code> has been added.  It makes

Cheers,
Ralf
Gerald Pfeifer - Jan. 9, 2011, 1:22 a.m.
On Fri, 7 Jan 2011, Jan Hubicka wrote:
> this patch mention function reordering.

This looks good (with the change Ralf (who will soon allow me to 
retire ;-) suggested).

Thanks,
Gerald

Patch

Index: changes.html
===================================================================
RCS file: /cvs/gcc/wwwdocs/htdocs/gcc-4.6/changes.html,v
retrieving revision 1.73
diff -u -r1.73 changes.html
--- changes.html	27 Nov 2010 10:26:28 -0000	1.73
+++ changes.html	7 Jan 2011 17:59:35 -0000
@@ -65,7 +65,7 @@ 
            now split itself into multiple parallel compilations. Parallelism
            is controlled with <code>-flto=<em>n</em></code> (where
            <em>n</em> specifies the number of compilations to execute in
-           parallel.  GCC can also cooperate with a GNU make job server
+           parallel).  GCC can also cooperate with a GNU make job server
            by specifying the <code>-flto=jobserver</code> option and
            adding <code>+</code> to the beginning of the
            Makefile rule executing the linker.</li>
@@ -136,6 +136,19 @@ 
             Unlikely executed functions are optimized for size.  Functions
             executed once are optimized for size except for the inner
             loops.</li>
+	  <li>On most targets with named section support the functions used only
+	    at startup (static constructors and <code>main</code>), functions used
+	    only at exit and functions detected to be cold are placed into separate
+	    text segment subsections.
+	    This extends <code>-freorder-functions</code> feature and is
+	    controlled by the same switch. The goal is to improve startup time of large
+	    C++ programs.
+	    <p>Proper function placement require linker support.
+	    GNU ld 2.21.51 on ELF targets was updated to place
+	    those functions together within the text section leading to better code
+	    locality and faster startup times of large C++ programs. Support in gold
+	    linker is planned.</p>
+	    </li>
       </ul>
       </li>
       <li>A new switch <code>-fstack-usage</code> has been added.  It makes