diff gcc/doc/lto.texi @ 111:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents 561a7518be6b
children 84e7813d76e9
line wrap: on
line diff
--- a/gcc/doc/lto.texi	Sun Aug 21 07:07:55 2011 +0900
+++ b/gcc/doc/lto.texi	Fri Oct 27 22:46:09 2017 +0900
@@ -1,5 +1,4 @@
-@c Copyright (c) 2010 Free Software Foundation, Inc.
-@c Free Software Foundation, Inc.
+@c Copyright (C) 2010-2017 Free Software Foundation, Inc.
 @c This is part of the GCC manual.
 @c For copying conditions, see the file gcc.texi.
 @c Contributed by Jan Hubicka <jh@suse.cz> and
@@ -12,6 +11,24 @@
 @cindex wpa
 @cindex ltrans
 
+Link Time Optimization (LTO) gives GCC the capability of
+dumping its internal representation (GIMPLE) to disk,
+so that all the different compilation units that make up
+a single executable can be optimized as a single module.
+This expands the scope of inter-procedural optimizations
+to encompass the whole program (or, rather, everything
+that is visible at link time).
+
+@menu
+* LTO Overview::            Overview of LTO.
+* LTO object file layout::  LTO file sections in ELF.
+* IPA::                     Using summary information in IPA passes.
+* WHOPR::                   Whole program assumptions,
+                            linker plugin and symbol visibilities.
+* Internal flags::          Internal flags controlling @code{lto1}.
+@end menu
+
+@node LTO Overview
 @section Design Overview
 
 Link time optimization is implemented as a GCC front end for a
@@ -26,7 +43,7 @@
 the files.  Additionally, one might be able to ship one set of fat
 objects which could be used both for development and the production of
 optimized builds.  A, perhaps surprising, side effect of this feature
-is that any mistake in the toolchain that leads to LTO information not
+is that any mistake in the toolchain leads to LTO information not
 being used (e.g.@: an older @code{libtool} calling @code{ld} directly).
 This is both an advantage, as the system is more robust, and a
 disadvantage, as the user is not informed that the optimization has
@@ -134,6 +151,7 @@
 whole program into memory.
 
 
+@node LTO object file layout
 @section LTO file sections
 
 LTO information is stored in several ELF sections inside object files.
@@ -246,6 +264,7 @@
 @end itemize
 
 
+@node IPA
 @section Using summary information in IPA passes
 
 Programs are represented internally as a @emph{callgraph} (a
@@ -448,6 +467,7 @@
 devirtualization pass.  The inliner also uses jump functions to
 perform inlining of callbacks.
 
+@node WHOPR
 @section Whole program assumptions, linker plugin and symbol visibilities
 
 Link-time optimization gives relatively minor benefits when used
@@ -455,7 +475,7 @@
 information does not work well across functions and variables
 that are called or referenced by other compilation units (such as
 from a dynamically linked library).  We say that such functions
-are variables are @emph{externally visible}.
+and variables are @emph{externally visible}.
 
 To make the situation even more difficult, many applications
 organize themselves as a set of shared libraries, and the default
@@ -518,10 +538,6 @@
 which symbols provided by the claimed objects are bound from the
 rest of a binary being linked.
 
-Currently, the linker plugin  works only in combination
-with the Gold linker, but a GNU ld implementation is under
-development.
-
 GCC is designed to be independent of the rest of the toolchain
 and aims to support linkers without plugin support.  For this
 reason it does not use the linker plugin by default.  Instead,
@@ -536,6 +552,7 @@
 plugin GCC also assumes that symbols are declared @code{hidden}
 and not referred by non-LTO code by default.
 
+@node Internal flags
 @section Internal flags controlling @code{lto1}
 
 The following flags are passed into @command{lto1} and are not
@@ -565,4 +582,10 @@
 This option specifies a file to which the names of LTRANS output
 files are written.  This option is only meaningful in conjunction
 with @option{-fwpa}.
+
+@item -fresolution=@var{file}
+@opindex fresolution
+This option specifies the linker resolution file.  This option is
+only meaningful in conjunction with @option{-fwpa} and as option
+to pass through to the LTO linker plugin.
 @end itemize