From aa3d6242cfb3a21922f7ec13cbd5b65303a51f80 Mon Sep 17 00:00:00 2001 From: NAKAMURA Takumi Date: Sat, 23 Apr 2011 00:30:22 +0000 Subject: docs: Introduce cascading style
and

continued on .

Section Example

Section preamble.

Subsection Example

Subsection body

FIXME: Care H5 better. llvm-svn: 130040 --- llvm/docs/LinkTimeOptimization.html | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) (limited to 'llvm/docs/LinkTimeOptimization.html') diff --git a/llvm/docs/LinkTimeOptimization.html b/llvm/docs/LinkTimeOptimization.html index 720a5e460ab..b3bc4814fdc 100644 --- a/llvm/docs/LinkTimeOptimization.html +++ b/llvm/docs/LinkTimeOptimization.html @@ -41,7 +41,7 @@ -
+

LLVM features powerful intermodular optimizations which can be used at link time. Link Time Optimization (LTO) is another name for intermodular optimization @@ -55,7 +55,7 @@ and design between the LTO optimizer and the linker.

-
+

The LLVM Link Time Optimizer provides complete transparency, while doing intermodular optimization, in the compiler tool chain. Its main goal is to let @@ -69,14 +69,13 @@ the linker and LLVM optimizer helps to do optimizations that are not possible in other models. The linker input allows the optimizer to avoid relying on conservative escape analysis.

-

Example of link time optimization

-
+

The following example illustrates the advantages of LTO's integrated approach and clean interface. This example requires a system linker which supports LTO through the interface described in this document. Here, @@ -149,7 +148,7 @@ $ llvm-gcc a.o main.o -o main # <-- standard link command without any modific Alternative Approaches -

+
Compiler driver invokes link time optimizer separately.
In this model the link time optimizer is not able to take advantage of @@ -175,12 +174,14 @@ $ llvm-gcc a.o main.o -o main # <-- standard link command without any modific
+
+

Multi-phase communication between libLTO and linker

-
+

The linker collects information about symbol defininitions and uses in various link objects which is more accurate than any information collected by other tools during typical build cycles. The linker collects this @@ -192,14 +193,13 @@ $ llvm-gcc a.o main.o -o main # <-- standard link command without any modific Our goal is to take advantage of tight integration between the linker and the optimizer by sharing this information during various linking phases.

-

Phase 1 : Read LLVM Bitcode Files

-
+

The linker first reads all object files in natural order and collects symbol information. This includes native object files as well as LLVM bitcode files. To minimize the cost to the linker in the case that all .o files @@ -223,7 +223,7 @@ $ llvm-gcc a.o main.o -o main # <-- standard link command without any modific Phase 2 : Symbol Resolution -

+

In this stage, the linker resolves symbols using global symbol table. It may report undefined symbol errors, read archive members, replace weak symbols, etc. The linker is able to do this seamlessly even though it @@ -236,7 +236,7 @@ $ llvm-gcc a.o main.o -o main # <-- standard link command without any modific

Phase 3 : Optimize Bitcode Files

-
+

After symbol resolution, the linker tells the LTO shared object which symbols are needed by native object files. In the example above, the linker reports that only foo1() is used by native object files using @@ -252,7 +252,7 @@ $ llvm-gcc a.o main.o -o main # <-- standard link command without any modific Phase 4 : Symbol Resolution after optimization -

+

In this phase, the linker reads optimized a native object file and updates the internal global symbol table to reflect any changes. The linker also collects information about any changes in use of external symbols by @@ -264,12 +264,14 @@ $ llvm-gcc a.o main.o -o main # <-- standard link command without any modific bitcode files.

+
+

libLTO

-
+

libLTO is a shared object that is part of the LLVM tools, and is intended for use by a linker. libLTO provides an abstract C interface to use the LLVM interprocedural optimizer without exposing details @@ -278,14 +280,13 @@ $ llvm-gcc a.o main.o -o main # <-- standard link command without any modific be possible for a completely different compilation technology to provide a different libLTO that works with their object files and the standard linker tool.

-

lto_module_t

-
+

A non-native object file is handled via an lto_module_t. The following functions allow the linker to check if a file (on disk @@ -329,7 +330,7 @@ lto_module_get_symbol_attribute(lto_module_t, unsigned int) lto_code_gen_t -

+

Once the linker has loaded each non-native object files into an lto_module_t, it can request libLTO to process them all and @@ -371,6 +372,8 @@ of the native object files.

+
+
-- cgit v1.2.3