llvm.org GIT mirror llvm / 0428962
Reduce line length to about 80 chars. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13538 91177308-0d34-0410-b5e6-96231b3b80d8 Reid Spencer 15 years ago
1 changed file(s) with 43 addition(s) and 6 deletion(s). Raw diff Collapse all Expand all
0 By Chris:
11
2 LLVM has been designed with two primary goals in mind. First we strive to enable the best possible division of labor between static and dynamic compilers, and second, we need a flexible and powerful interface between these two complementary stages of compilation. We feel that providing a solution to these two goals will yield an excellent solution to the performance problem faced by modern architectures and programming languages.
2 LLVM has been designed with two primary goals in mind. First we strive to
3 enable the best possible division of labor between static and dynamic
4 compilers, and second, we need a flexible and powerful interface
5 between these two complementary stages of compilation. We feel that
6 providing a solution to these two goals will yield an excellent solution
7 to the performance problem faced by modern architectures and programming
8 languages.
39
4 A key insight into current compiler and runtime systems is that a compiler may fall in anywhere in a "continuum of compilation" to do its job. On one side, scripting languages statically compile nothing and dynamically compile (or equivalently, interpret) everything. On the far other side, traditional static compilers process everything statically and nothing dynamically. These approaches have typically been seen as a tradeoff between performance and portability. On a deeper level, however, there are two reasons that optimal system performance may be obtained by a system somewhere in between these two extremes: Dynamic application behavior and social constraints.
10 A key insight into current compiler and runtime systems is that a
11 compiler may fall in anywhere in a "continuum of compilation" to do its
12 job. On one side, scripting languages statically compile nothing and
13 dynamically compile (or equivalently, interpret) everything. On the far
14 other side, traditional static compilers process everything statically and
15 nothing dynamically. These approaches have typically been seen as a
16 tradeoff between performance and portability. On a deeper level, however,
17 there are two reasons that optimal system performance may be obtained by a
18 system somewhere in between these two extremes: Dynamic application
19 behavior and social constraints.
520
6 From a technical perspective, pure static compilation cannot ever give optimal performance in all cases, because applications have varying dynamic behavior that the static compiler cannot take into consideration. Even compilers that support profile guided optimization generate poor code in the real world, because using such optimization tunes that application to one particular usage pattern, whereas real programs (as opposed to benchmarks) often have several different usage patterns.
21 From a technical perspective, pure static compilation cannot ever give
22 optimal performance in all cases, because applications have varying dynamic
23 behavior that the static compiler cannot take into consideration. Even
24 compilers that support profile guided optimization generate poor code in
25 the real world, because using such optimization tunes that application
26 to one particular usage pattern, whereas real programs (as opposed to
27 benchmarks) often have several different usage patterns.
728
8 On a social level, static compilation is a very shortsighted solution to the performance problem. Instruction set architectures (ISAs) continuously evolve, and each implementation of an ISA (a processor) must choose a set of tradeoffs that make sense in the market context that it is designed for. With every new processor introduced, the vendor faces two fundamental problems: First, there is a lag time between when a processor is introduced to when compilers generate quality code for the architecture. Secondly, even when compilers catch up to the new architecture there is often a large body of legacy code that was compiled for previous generations and will not or can not be upgraded. Thus a large percentage of code running on a processor may be compiled quite sub-optimally for the current characteristics of the dynamic execution environment.
29 On a social level, static compilation is a very shortsighted solution to
30 the performance problem. Instruction set architectures (ISAs) continuously
31 evolve, and each implementation of an ISA (a processor) must choose a set
32 of tradeoffs that make sense in the market context that it is designed for.
33 With every new processor introduced, the vendor faces two fundamental
34 problems: First, there is a lag time between when a processor is introduced
35 to when compilers generate quality code for the architecture. Secondly,
36 even when compilers catch up to the new architecture there is often a large
37 body of legacy code that was compiled for previous generations and will
38 not or can not be upgraded. Thus a large percentage of code running on a
39 processor may be compiled quite sub-optimally for the current
40 characteristics of the dynamic execution environment.
941
10 For these reasons, LLVM has been designed from the beginning as a long-term solution to these problems. Its design allows the large body of platform independent, static, program optimizations currently in compilers to be reused unchanged in their current form. It also provides important static type information to enable powerful dynamic and link time optimizations to be performed quickly and efficiently. This combination enables an increase in effective system performance for real world environments.
11
42 For these reasons, LLVM has been designed from the beginning as a long-term
43 solution to these problems. Its design allows the large body of platform
44 independent, static, program optimizations currently in compilers to be
45 reused unchanged in their current form. It also provides important static
46 type information to enable powerful dynamic and link time optimizations
47 to be performed quickly and efficiently. This combination enables an
48 increase in effective system performance for real world environments.