From patchwork Tue Sep 27 13:51:18 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [wwwdocs] Add info about IPA optimization and LTO improvments Date: Tue, 27 Sep 2011 03:51:18 -0000 From: Jan Hubicka X-Patchwork-Id: 116605 Message-Id: <20110927135118.GA793@atrey.karlin.mff.cuni.cz> To: Andi Kleen Cc: Jan Hubicka , gcc-patches@gcc.gnu.org, gerald@pfeifer.com, mjambor@suse.cz Gerald, Andi, thanks for corrections. This is what I've comitted now. Index: changes.html =================================================================== RCS file: /cvs/gcc/wwwdocs/htdocs/gcc-4.7/changes.html,v retrieving revision 1.33 diff -u -r1.33 changes.html --- changes.html 25 Sep 2011 22:49:42 -0000 1.33 +++ changes.html 27 Sep 2011 13:50:13 -0000 @@ -58,6 +58,68 @@ was added to allow users to control the cutoff between doing switch statements as a series of if statements and using a jump table. +
  • Link-time optimization improvements: +
      +
    • Improved scalability and reduced memory usage. Link time optimization + of Firefox now requires 3GB of RAM on a 64bit system, while over 8GB was needed + previously. Linking time has been improved, too. The serial stage of linking + Firefox binary has been sped up approximately by factor of 10.
    • +
    • Reduced size of object files and temporary storage used during linking.
    • +
    • Streaming performance (both outbound and inbound) has been improved.
    • +
    • ld -r is now supported with LTO.
    • +
    • Several bug fixes, especially in symbol table handling and merging.
    • +
    +
  • Interprocedural optimization improvements: +
  • Inliner heuristic can now take into account that after inlining + code will be optimized out because of known values (or properties) of function parameters. + For example: +
    +void foo(int a)
    +{
    +  if (a>10)
    +    ... huge code ...
    +}
    +void bar (void)
    +{
    +  foo (0);
    +}
    +      
    + The call of foo will be inlined into bar even when + optimizing for code size. Constructs based on __builtin_constant_p + are now understood by the inliner and code size estimates are evaluated a lot + more realistically.
  • +
  • The representation of C++ virtual thunks and aliases (both implicit and defined + via aliasattribute) has been re-engineered. The aliases no + longer pose optimization barriers and calls to an alias can be inlined + and otherwise optimized.
  • +
  • The inter-procedural constant propagation pass has been rewritten. + It now performs generic function specialization. For example when + compiling the following: +
    +void foo(bool flag)
    +{
    +  if (flag)
    +    ... do something ...
    +  else
    +    ... do something else ...
    +}
    +void bar (void)
    +{
    +  foo (false);
    +  foo (true);
    +  foo (false);
    +  foo (true);
    +  foo (false);
    +  foo (true);
    +}
    +      
    + GCC will now produce two copies of foo. One with flag being + true, while other with flag being + false. This leads to performance improvements previously + possibly only by inlining all calls. Cloning causes a lot less code size + growth. +
      +

    New Languages and Language specific improvements