This document contains the release notes for the LLVM Compiler
-Infrastructure, release 2.6. Here we describe the status of LLVM, including
+Infrastructure, release 2.7. Here we describe the status of LLVM, including
major improvements from the previous release and significant known problems.
All LLVM releases may be downloaded from the LLVM releases web site.
An exciting aspect of LLVM is that it is used as an enabling technology for
a lot of other language and tools projects. This section lists some of the
- projects that have already been updated to work with LLVM 2.6.
+ projects that have already been updated to work with LLVM 2.7.
@@ -376,8 +308,8 @@ built-in list and matrix support (including list and matrix comprehensions) and
an easy-to-use C interface. The interpreter uses LLVM as a backend to
JIT-compile Pure programs to fast native code.
-
Pure versions 0.31 and later have been tested and are known to work with
-LLVM 2.6 (and continue to work with older LLVM releases >= 2.3 as well).
+
Pure versions ??? and later have been tested and are known to work with
+LLVM 2.7 (and continue to work with older LLVM releases >= 2.3 as well).
Debug information now includes line numbers when optimizations are enabled.
- This allows statistical sampling tools like OProfile and Shark to map
- samples back to source lines.
-
LLVM now includes new experimental backends to support the MSP430, SystemZ
- and BlackFin architectures.
LLVM now supports doing optimization and code generation on multiple
- threads. Please see the LLVM
- Programmer's Manual for more information.
-
LLVM now has experimental support for embedded
- metadata in LLVM IR, though the implementation is not guaranteed to be
- final and the .bc file format may change in future releases. Debug info
- does not yet use this format in LLVM 2.6.
+
...
@@ -516,50 +430,7 @@ in this section.
expose new optimization opportunities:
-
The add, sub and mul
- instructions have been split into integer and floating point versions (like
- divide and remainder), introducing new fadd, fsub,
- and fmul instructions.
-
The add, sub and mul
- instructions now support optional "nsw" and "nuw" bits which indicate that
- the operation is guaranteed to not overflow (in the signed or
- unsigned case, respectively). This gives the optimizer more information and
- can be used for things like C signed integer values, which are undefined on
- overflow.
-
The sdiv instruction now supports an
- optional "exact" flag which indicates that the result of the division is
- guaranteed to have a remainder of zero. This is useful for optimizing pointer
- subtraction in C.
-
The getelementptr instruction now
- supports arbitrary integer index values for array/pointer indices. This
- allows for better code generation on 16-bit pointer targets like PIC16.
-
The getelementptr instruction now
- supports an "inbounds" optimization hint that tells the optimizer that the
- pointer is guaranteed to be within its allocated object.
-
LLVM now support a series of new linkage types for global values which allow
- for better optimization and new capabilities:
-
-
linkonce_odr and
- weak_odr have the same linkage
- semantics as the non-"odr" linkage types. The difference is that these
- linkage types indicate that all definitions of the specified function
- are guaranteed to have the same semantics. This allows inlining
- templates functions in C++ but not inlining weak functions in C,
- which previously both got the same linkage type.
-
available_externally
- is a new linkage type that gives the optimizer visibility into the
- definition of a function (allowing inlining and side effect analysis)
- but that does not cause code to be generated. This allows better
- optimization of "GNU inline" functions, extern templates, etc.
-
linker_private is a
- new linkage type (which is only useful on Mac OS X) that is used for
- some metadata generation and other obscure things.
-
-
Finally, target-specific intrinsics can now return multiple values, which
- is useful for modeling target operations with multiple results.
+
...
@@ -576,23 +447,7 @@ release includes a few major enhancements and additions to the optimizers:
-
The Scalar Replacement of Aggregates
- pass has many improvements that allow it to better promote vector unions,
- variables which are memset, and much more strange code that can happen to
- do bitfield accesses to register operations. An interesting change is that
- it now produces "unusual" integer sizes (like i1704) in some cases and lets
- other optimizers clean things up.
-
The Loop Strength Reduction pass now
- promotes small integer induction variables to 64-bit on 64-bit targets,
- which provides a major performance boost for much numerical code. It also
- promotes shorts to int on 32-bit hosts, etc. LSR now also analyzes pointer
- expressions (e.g. getelementptrs), as well as integers.
-
The GVN pass now eliminates partial
- redundancies of loads in simple cases.
-
The Inliner now reuses stack space when
- inlining similar arrays from multiple callees into one caller.
-
LLVM includes a new experimental Static Single Information (SSI)
- construction pass.
+
...
@@ -607,17 +462,7 @@ release includes a few major enhancements and additions to the optimizers:
-
LLVM has a new "EngineBuilder" class which makes it more obvious how to
- set up and configure an ExecutionEngine (a JIT or interpreter).
-
The JIT now supports generating more than 16M of code.
-
When configured with --with-oprofile, the JIT can now inform
- OProfile about JIT'd code, allowing OProfile to get line number and function
- name information for JIT'd functions.
-
When "libffi" is available, the LLVM interpreter now uses it, which supports
- calling almost arbitrary external (natively compiled) functions.
-
Clients of the JIT can now register a 'JITEventListener' object to receive
- callbacks when the JIT emits or frees machine code. The OProfile support
- uses this mechanism.
+
...
@@ -635,54 +480,7 @@ it run faster:
-
The llc -asm-verbose option (exposed from llvm-gcc as -dA
- and clang as -fverbose-asm or -dA) now adds a lot of
- useful information in comments to
- the generated .s file. This information includes location information (if
- built with -g) and loop nest information.
-
The code generator now supports a new MachineVerifier pass which is useful
- for finding bugs in targets and codegen passes.
-
The Machine LICM is now enabled by default. It hoists instructions out of
- loops (such as constant pool loads, loads from read-only stubs, vector
- constant synthesization code, etc.) and is currently configured to only do
- so when the hoisted operation can be rematerialized.
-
The Machine Sinking pass is now enabled by default. This pass moves
- side-effect free operations down the CFG so that they are executed on fewer
- paths through a function.
-
The code generator now performs "stack slot coloring" of register spills,
- which allows spill slots to be reused. This leads to smaller stack frames
- in cases where there are lots of register spills.
-
The register allocator has many improvements to take better advantage of
- commutable operations, various spiller peephole optimizations, and can now
- coalesce cross-register-class copies.
-
Tblgen now supports multiclass inheritance and a number of new string and
- list operations like !(subst), !(foreach), !car,
- !cdr, !null, !if, !cast.
- These make the .td files more expressive and allow more aggressive factoring
- of duplication across instruction patterns.
-
Target-specific intrinsics can now be added without having to hack VMCore to
- add them. This makes it easier to maintain out-of-tree targets.
-
The instruction selector is better at propagating information about values
- (such as whether they are sign/zero extended etc.) across basic block
- boundaries.
-
The SelectionDAG datastructure has new nodes for representing buildvector
- and vector shuffle operations. This
- makes operations and pattern matching more efficient and easier to get
- right.
-
The Prolog/Epilog Insertion Pass now has experimental support for performing
- the "shrink wrapping" optimization, which moves spills and reloads around in
- the CFG to avoid doing saves on paths that don't need them.
-
LLVM includes new experimental support for writing ELF .o files directly
- from the compiler. It works well for many simple C testcases, but doesn't
- support exception handling, debug info, inline assembly, etc.
-
Targets can now specify register allocation hints through
- MachineRegisterInfo::setRegAllocationHint. A regalloc hint consists
- of hint type and physical register number. A hint type of zero specifies a
- register allocation preference. Other hint type values are target specific
- which are resolved by TargetRegisterInfo::ResolveRegAllocHint. An
- example is the ARM target which uses register hints to request that the
- register allocator provide an even / odd register pair to two virtual
- registers.
+
...
@@ -697,31 +495,7 @@ it run faster:
-
SSE 4.2 builtins are now supported.
-
GCC-compatible soft float modes are now supported, which are typically used
- by OS kernels.
-
X86-64 now models implicit zero extensions better, which allows the code
- generator to remove a lot of redundant zexts. It also models the 8-bit "H"
- registers as subregs, which allows them to be used in some tricky
- situations.
-
X86-64 now supports the "local exec" and "initial exec" thread local storage
- model.
-
The vector forms of the icmp and fcmp instructions now select to efficient
- SSE operations.
-
Support for the win64 calling conventions have improved. The primary
- missing feature is support for varargs function definitions. It seems to
- work well for many win64 JIT purposes.
-
The X86 backend has preliminary support for mapping address spaces to segment
- register references. This allows you to write GS or FS relative memory
- accesses directly in LLVM IR for cases where you know exactly what you're
- doing (such as in an OS kernel). There are some known problems with this
- support, but it works in simple cases.
-
The X86 code generator has been refactored to move all global variable
- reference logic to one place
- (X86Subtarget::ClassifyGlobalReference) which
- makes it easier to reason about.
+
...
@@ -737,11 +511,7 @@ it run faster:
-
Support for floating-point, indirect function calls, and
- passing/returning aggregate types to functions.
-
The code generator is able to generate debug info into output COFF files.
-
Support for placing an object into a specific section or at a specific
- address in memory.
+
...
Things not yet supported:
@@ -764,22 +534,9 @@ it run faster:
-
Preliminary support for processors, such as the Cortex-A8 and Cortex-A9,
-that implement version v7-A of the ARM architecture. The ARM backend now
-supports both the Thumb2 and Advanced SIMD (Neon) instruction sets.
-
-
The AAPCS-VFP "hard float" calling conventions are also supported with the
--float-abi=hard flag.
-
-
The ARM calling convention code is now tblgen generated instead of resorting
- to C++ code.
+
...
-
These features are still somewhat experimental
-and subject to change. The Neon intrinsics, in particular, may change in future
-releases of LLVM. ARMv7 support has progressed a lot on top of tree since 2.6
-branched.
-
@@ -793,11 +550,7 @@ branched.
-
Mips now supports O32 Calling Convention.
-
Many improvements to the 32-bit PowerPC SVR4 ABI (used on powerpc-linux)
- support, lots of bugs fixed.
-
Added support for the 64-bit PowerPC SVR4 ABI (used on powerpc64-linux).
- Needs more testing.
+
...
@@ -814,40 +567,7 @@ branched.
-
New
- PrettyStackTrace class allows crashes of llvm tools (and applications
- that integrate them) to provide more detailed indication of what the
- compiler was doing at the time of the crash (e.g. running a pass).
- At the top level for each LLVM tool, it includes the command line arguments.
-
-
New StringRef
- and Twine classes
- make operations on character ranges and
- string concatenation to be more efficient. StringRef is just a const
- char* with a length, Twine is a light-weight rope.
-
LLVM has new WeakVH, AssertingVH and CallbackVH
- classes, which make it easier to write LLVM IR transformations. WeakVH
- is automatically drops to null when the referenced Value is deleted,
- and is updated across a replaceAllUsesWith operation.
- AssertingVH aborts the program if the
- referenced value is destroyed while it is being referenced. CallbackVH
- is a customizable class for handling value references. See ValueHandle.h
- for more information.
-
The new 'Triple
- ' class centralizes a lot of logic that reasons about target
- triples.
-
The new '
- llvm_report_error()' set of APIs allows tools to embed the LLVM
- optimizer and backend and recover from previously unrecoverable errors.
LLVM has new
- SourceMgr and SMLoc classes which implement caret
- diagnostics and basic include stack processing for simple parsers. It is
- used by tablegen, llvm-mc, the .ll parser and FileCheck.
+
...
@@ -862,32 +582,7 @@ branched.
Other miscellaneous features include:
-
LLVM now includes a new internal 'FileCheck' tool which allows
- writing much more accurate regression tests that run faster. Please see the
- FileCheck section of the Testing
- Guide for more information.
-
LLVM profile information support has been significantly improved to produce
-correct use counts, and has support for edge profiling with reduced runtime
-overhead. Combined, the generated profile information is both more correct and
-imposes about half as much overhead (2.6. from 12% to 6% overhead on SPEC
-CPU2000).
-
The C bindings (in the llvm/include/llvm-c directory) include many newly
- supported APIs.
-
LLVM 2.6 includes a brand new experimental LLVM bindings to the Ada2005
- programming language.
-
-
The LLVMC driver has several new features:
-
-
Dynamic plugins now work on Windows.
-
New option property: init. Makes possible to provide default values for
- options defined in plugins (interface to cl::init).
-
New example: Skeleton, shows how to create a standalone LLVMC-based
- driver.
-
New example: mcc16, a driver for the PIC16 toolchain.
-
-
-
+
...
@@ -901,24 +596,11 @@ CPU2000).
If you're already an LLVM user or developer with out-of-tree changes based
-on LLVM 2.5, this section lists some "gotchas" that you may run into upgrading
+on LLVM 2.6, this section lists some "gotchas" that you may run into upgrading
from the previous release.
-
The Itanium (IA64) backend has been removed. It was not actively supported
- and had bitrotted.
-
The BigBlock register allocator has been removed, it had also bitrotted.
-
The C Backend (-march=c) is no longer considered part of the LLVM release
-criteria. We still want it to work, but no one is maintaining it and it lacks
-support for arbitrary precision integers and other important IR features.
-
-
All LLVM tools now default to overwriting their output file, behaving more
- like standard unix tools. Previously, this only happened with the '-f'
- option.
-
LLVM build now builds all libraries as .a files instead of some
- libraries as relinked .o files. This requires some APIs like
- InitializeAllTargets.h.
-
+
...
@@ -926,82 +608,7 @@ support for arbitrary precision integers and other important IR features.
API changes are:
-
All uses of hash_set and hash_map have been removed from
- the LLVM tree and the wrapper headers have been removed.
-
The llvm/Streams.h and DOUT member of Debug.h have been removed. The
- llvm::Ostream class has been completely removed and replaced with
- uses of raw_ostream.
-
LLVM's global uniquing tables for Types and Constants have
- been privatized into members of an LLVMContext. A number of APIs
- now take an LLVMContext as a parameter. To smooth the transition
- for clients that will only ever use a single context, the new
- getGlobalContext() API can be used to access a default global
- context which can be passed in any and all cases where a context is
- required.
-
The getABITypeSize methods are now called getAllocSize.
-
The Add, Sub and Mul operators are no longer
- overloaded for floating-point types. Floating-point addition, subtraction
- and multiplication are now represented with new operators FAdd,
- FSub and FMul. In the IRBuilder API,
- CreateAdd, CreateSub, CreateMul and
- CreateNeg should only be used for integer arithmetic now;
- CreateFAdd, CreateFSub, CreateFMul and
- CreateFNeg should now be used for floating-point arithmetic.
-
The DynamicLibrary class can no longer be constructed, its functionality has
- moved to static member functions.
-
raw_fd_ostream's constructor for opening a given filename now
- takes an extra Force argument. If Force is set to
- false, an error will be reported if a file with the given name
- already exists. If Force is set to true, the file will
- be silently truncated (which is the behavior before this flag was
- added).
-
SCEVHandle no longer exists, because reference counting is no
- longer done for SCEV* objects, instead const SCEV*
- should be used.
-
-
Many APIs, notably llvm::Value, now use the StringRef
-and Twine classes instead of passing const char*
-or std::string, as described in
-the Programmer's Manual. Most
-clients should be unaffected by this transition, unless they are used to
-Value::getName() returning a string. Here are some tips on updating to
-2.6:
-
-
getNameStr() is still available, and matches the old
- behavior. Replacing getName() calls with this is an safe option,
- although more efficient alternatives are now possible.
-
-
If you were just relying on getName() being able to be sent to
- a std::ostream, consider migrating
- to llvm::raw_ostream.
-
-
If you were using getName().c_str() to get a const
- char* pointer to the name, you can use getName().data().
- Note that this string (as before), may not be the entire name if the
- name contains embedded null characters.
-
-
If you were using operator + on the result of getName() and
- treating the result as an std::string, you can either
- use Twine::str to get the result as an std::string, or
- could move to a Twine based design.
-
-
isName() should be replaced with comparison
- against getName() (this is now efficient).
-
-
-
-
The registration interfaces for backend Targets has changed (what was
-previously TargetMachineRegistry). For backend authors, see the Writing An LLVM Backend
-guide. For clients, the notable API changes are:
-
-
TargetMachineRegistry has been renamed
- to TargetRegistry.
-
-
Clients should move to using the TargetRegistry::lookupTarget()
- function to find targets.
-
-
+
...
@@ -1055,8 +662,8 @@ there isn't already one.
The llvm-gcc bootstrap will fail with some versions of binutils (e.g. 2.15)
with a message of "Error: can not do 8
byte pc-relative relocation" when building C++ code. We intend to
- fix this on mainline, but a workaround for 2.6 is to upgrade to binutils
- 2.17 or later.
+ fix this on mainline, but a workaround is to upgrade to binutils 2.17 or
+ later.
LLVM will not correctly compile on Solaris and/or OpenSolaris
using the stock GCC 3.x.x series 'out the box',