This document contains the release notes for the LLVM compiler
-infrastructure, release 2.0. Here we describe the status of LLVM, including
+infrastructure, release 2.1. Here we describe the status of LLVM, including
major improvements from the previous release and any known problems. All LLVM
releases may be downloaded from the LLVM
releases web site.
@@ -44,10 +44,9 @@ href="http://mail.cs.uiuc.edu/mailman/listinfo/llvmdev">LLVM developer's mailing
list is a good place to send them.
Note that if you are reading this file from a Subversion checkout or the
-main LLVM web page,
-this document applies to the next release, not the current one. To see
-the release notes for the current or previous releases, see the releases page.
+main LLVM web page, this document applies to the
next release, not the
+current one. To see the release notes for a specific releases, please see the
+
releases page.
@@ -59,416 +58,235 @@ href="http://llvm.org/releases/">releases page.
-
This is the eleventh public release of the LLVM Compiler Infrastructure.
-Being the first major release since 1.0, this release is different in several
-ways from our previous releases:
-
-
-- We took this as an opportunity to
-break backwards compatibility with the LLVM 1.x bytecode and .ll file format.
-If you have LLVM 1.9 .ll files that you would like to upgrade to LLVM 2.x, we
-recommend the use of the stand alone llvm-upgrade
-tool (which is included with 2.0). We intend to keep compatibility with .ll
-and .bc formats within the 2.x release series, like we did within the 1.x
-series.
-- There are several significant change to the LLVM IR and internal APIs, such
- as a major overhaul of the type system, the completely new bitcode file
- format, etc (described below).
-- We designed the release around a 6 month release cycle instead of the usual
- 3-month cycle. This gave us extra time to develop and test some of the
- more invasive features in this release.
-- LLVM 2.0 no longer supports the llvm-gcc3 front-end. Users are required to
- upgrade to llvm-gcc4. llvm-gcc4 includes many features over
- llvm-gcc3, is faster, and is much easier to
- build from source.
-
-
-
Note that while this is a major version bump, this release has been
- extensively tested on a wide range of software. It is easy to say that this
- is our best release yet, in terms of both features and correctness. This is
- the first LLVM release to correctly compile and optimize major software like
- LLVM itself, Mozilla/Seamonkey, Qt 4.3rc1, kOffice, etc out of the box on
- linux/x86.
-
+
This is the twelfth public release of the LLVM Compiler Infrastructure.
+It includes many features and refinements from LLVM 2.0.
-
Changes to the LLVM IR itself:
+
LLVM 2.1 brings two new beta C front-ends. First, a new version of llvm-gcc
+based on GCC 4.2, innovatively called "llvm-gcc-4.2". This promises to bring
+FORTRAN and Ada support to LLVM as well as features like atomic builtins and
+OpenMP. None of these actually work yet, but don't let that stop you checking
+it out!
-
-
-- Integer types are now completely signless. This means that we
- have types like i8/i16/i32 instead of ubyte/sbyte/short/ushort/int
- etc. LLVM operations that depend on sign have been split up into
- separate instructions (PR950). This
- eliminates cast instructions that just change the sign of the operands (e.g.
- int -> uint), which reduces the size of the IR and makes optimizers
- simpler to write.
-
-- Integer types with arbitrary bitwidths (e.g. i13, i36, i42, i1057, etc) are
- now supported in the LLVM IR and optimizations (PR1043). However, neither llvm-gcc
- (PR1284) nor the native code generators
- (PR1270) support non-standard width
- integers yet.
-
-- 'Type planes' have been removed (PR411).
- It is no longer possible to have two values with the same name in the
- same symbol table. This simplifies LLVM internals, allowing significant
- speedups.
-
-- Global variables and functions in .ll files are now prefixed with
- @ instead of % (PR645).
-
-- The LLVM 1.x "bytecode" format has been replaced with a
- completely new binary representation, named 'bitcode'. The Bitcode Format brings a
- number of advantages to the LLVM over the old bytecode format: it is denser
- (files are smaller), more extensible, requires less memory to read,
- is easier to keep backwards compatible (so LLVM 2.5 will read 2.0 .bc
- files), and has many other nice features.
-
-- Load and store instructions now track the alignment of their pointer
- (PR400). This allows the IR to
- express loads that are not sufficiently aligned (e.g. due to '#pragma
- packed') or to capture extra alignment information.
-
-
-
Major new features:
-
-
-
-- A number of ELF features are now supported by LLVM, including 'visibility',
- extern weak linkage, Thread Local Storage (TLS) with the __thread
- keyword, and symbol aliases.
- Among other things, this means that many of the special options needed to
- configure llvm-gcc on linux are no longer needed, and special hacks to build
- large C++ libraries like Qt are not needed.
-
-- LLVM now has a new MSIL backend. llc -march=msil will now turn LLVM
- into MSIL (".net") bytecode. This is still fairly early development
- with a number of limitations.
-
-- A new llvm-upgrade tool
- exists to migrates LLVM 1.9 .ll files to LLVM 2.0 syntax.
-
+
Second, LLVM now includes its own native C and Objective-C front-end (C++ is
+in progress, but is not very far along) code named "clang". This front-end has a number of great
+features, primarily aimed at source-level analysis and speeding up compile-time.
+At this point though, the LLVM Code Generator component is still very early in
+development, so it's mostly useful for people looking to build source-level
+analysis tools or source-to-source translators.
+
+
-
New features include:
-
+
+
Some of the most noticable feature improvements this release have been in the
+optimizer, speeding it up and making it more aggressive. For example:
-- Precompiled Headers (PCH) are now supported.
-- "#pragma packed" is now supported, as are the various features
- described above (visibility, extern weak linkage, __thread, aliases,
- etc).
-
-- Tracking function parameter/result attributes is now possible.
-
-- Many internal enhancements have been added, such as improvements to
- NON_LVALUE_EXPR, arrays with non-zero base, structs with variable sized
- fields, VIEW_CONVERT_EXPR, CEIL_DIV_EXPR, nested functions, and many other
- things. This is primarily to supports non-C GCC front-ends, like Ada.
-
-- It is simpler to configure llvm-gcc for linux.
+- Owen Anderson wrote the new MemoryDependenceAnalysis pass, which provides
+ a lazy, caching layer on top of AliasAnalysis. He then used it to rewrite
+ DeadStoreElimination which resulted in significantly better compile time in
+ common cases,
+- Owen implemented the new GVN pass, which is also based on
+ MemoryDependenceAnalysis. This pass replaces GCSE/LoadVN in the standard
+ set of passes, providing more aggressive optimization at a some-what
+ improved compile-time cost.
+- Owen implemented GVN-PRE, a partial redundancy elimination algorithm that
+ shares some details with the new GVN pass. It is still in need of compile
+ time tuning, and is not turned on by default.
+- Devang merged ETForest and DomTree into a single easier to use data
+ structure. This makes it more obvious which datastructure to choose
+ (because there is only one) and makes the compiler more memory and time
+ efficient (less stuff to keep up-to-date).
+- Nick Lewycky improved loop trip count analysis to handle many more common
+ cases.
-
+
-
-
+
+
One of the main focuses of this release was performance tuning and bug
+ fixing. In addition to these, several new major changes occurred:
+
+
+
+- Dale finished up the Tail Merging optimization in the code generator, and
+ enabled it by default. This produces smaller code that is also faster in
+ some cases.
+
+- Christopher Lamb implemented support for virtual register sub-registers,
+ which can be used to better model many forms of subregisters. As an example
+ use, he modified the X86 backend to use this to model truncates and
+ extends more accurately (leading to better code).
+
+- Dan Gohman changed the way we represent vectors before legalization,
+ significantly simplifying the SelectionDAG representation for these and
+ making the code generator faster for vector code.
+
+- Evan contributed a new target independent if-converter. While it is
+ target independent, so far only the ARM backend uses it.
+
+- Evan rewrite the way the register allocator handles rematerialization,
+ allowing it to be much more effective on two-address targets like X86,
+ and taught it to fold loads away when possible (also a big win on X86).
+
+- Dan Gohman contributed support for better alignment and volatility handling
+ in the code generator, and significantly enhanced alignment analysis for SSE
+ load/store instructions. With his changes, an insufficiently-aligned SSE
+ load instruction turns into movups, for example.
+
+- Duraid Madina contributed a new "bigblock" register allocator, and Roman
+ Levenstein contributed several big improvements. BigBlock is optimized for
+ code that uses very large basic blocks. It is slightly slower than the
+ "local" allocator, but produces much better code.
+
+- David Greene refactored the register allocator to split coalescing out from
+ allocation, making coalescers pluggable.
+
+
+
+
+
+
+
+
+
New features include:
+- Neil Booth contributed a new "APFloat" class, which ensures that floating
+ point representation and constant folding is not dependent on the host
+ architecture that builds the application. This support is the foundation
+ for "long double" support that will be wrapped up in LLVM 2.2.
+
+- Based on the APFloat class, Dale redesigned the internals of the ConstantFP
+ class and has been working on extending the core and optimizer components to
+ support various target-specific 'long double's. We expect this work to be
+ completed in LLVM 2.2.
-- Inline assembly support is much more solid that before.
- The two primary features still missing are support for 80-bit floating point
- stack registers on X86 (PR879), and
- support for inline asm in the C backend (PR802).
-
-- DWARF debug information generation has been improved. LLVM now passes
- most of the GDB testsuite on MacOS and debug info is more dense.
-
-- Codegen support for Zero-cost DWARF exception handling has been added (PR592). It is mostly
- complete and just in need of continued bug fixes and optimizations at
- this point. However, support in llvm-g++ is disabled with an
- #ifdef for the 2.0 release (PR870).
-
-- The code generator now has more accurate and general hooks for
- describing addressing modes ("isLegalAddressingMode") to
- optimizations like loop strength reduction and code sinking.
-
-- Progress has been made on a direct Mach-o .o file writer. Many small
- apps work, but it is still not quite complete.
+- LLVM now provides an LLVMBuilder class, which makes it significantly easier
+ to create LLVM IR instructions.
+- Reid contributed support for intrinsics that take arbitrary integer typed
+ arguments. Dan Gohman and Chandler extended it to support arbitrary
+ floating point arguments and vectors.
-
-
In addition, the LLVM target description format has itself been extended in
- several ways:
-
-
-- TargetData now supports better target parameterization in
- the .ll/.bc files, eliminating the 'pointersize/endianness' attributes
- in the files (PR761).
-
-- TargetData was generalized for finer grained alignment handling,
- handling of vector alignment, and handling of preferred alignment
-
-- LLVM now supports describing target calling conventions
- explicitly in .td files, reducing the amount of C++ code that needs
- to be written for a port.
-
-
-
+
-
-
-
-
X86-specific Code Generator Enhancements:
+
New features include:
-- The MMX instruction set is now supported through intrinsics.
-- The scheduler was improved to better reduce register pressure on
- X86 and other targets that are register pressure sensitive.
-- Linux/x86-64 support is much better.
-- PIC support for linux/x86 has been added.
-- The X86 backend now supports the GCC regparm attribute.
-- LLVM now supports inline asm with multiple constraint letters per operand
- (like "mri") which is common in X86 inline asms.
+- Sterling Stein contributed a new BrainF frontend, located in llvm/examples.
+ This shows a some of the more modern APIs for building a front-end, and
+ demonstrates JIT compiler support.
+
+- David Green contributed a new --enable-expensive-checks configure
+ option which enables STL checking, and fixed several bugs exposed by
+ it.
-
-
ARM-specific Code Generator Enhancements:
-
-
-- The ARM code generator is now stable and fully supported.
-
-- There are major new features, including support for ARM
- v4-v6 chips, vfp support, soft float point support, pre/postinc support,
- load/store multiple generation, constant pool entry motion (to support
- large functions), inline asm support, weak linkage support, static
- ctor/dtor support and many bug fixes.
-
-- Added support for Thumb code generation (llc -march=thumb).
-
-- The ARM backend now supports the ARM AAPCS/EABI ABI and PIC codegen on
- arm/linux.
-
-- Several bugs were fixed for DWARF debug info generation on arm/linux.
-
-
-
-
PowerPC-specific Code Generator Enhancements:
-
-
-- The PowerPC 64 JIT now supports addressing code loaded above the 2G
- boundary.
-
-- Improved support for the Linux/ppc ABI and the linux/ppc JIT is fully
- functional now. llvm-gcc and static compilation are not fully supported
- yet though.
-
-- Many PowerPC 64 bug fixes.
-
-
-
+
-
-
-
-
-
More specific changes include:
-
-
-- LLVM no longer relies on static destructors to shut itself down. Instead,
- it lazily initializes itself and shuts down when llvm_shutdown() is
- explicitly called.
-
-- LLVM now has significantly fewer static constructors, reducing startup time.
-
-
-- Several classes have been refactored to reduce the amount of code that
- gets linked into apps that use the JIT.
-
-- Construction of intrinsic function declarations has been simplified.
-
-- The gccas/gccld tools have been replaced with small shell scripts.
-
-- Support has been added to llvm-test for running on low-memory
- or slow machines (make SMALL_PROBLEM_SIZE=1).
-
-
-
-
-
-
-
-
LLVM 2.0 contains a revamp of the type system and several other significant
-internal changes. If you are programming to the C++ API, be aware of the
-following major changes:
-
-
-- Pass registration is slightly different in LLVM 2.0 (you now need an
- intptr_t in your constructor), as explained in the Writing an LLVM Pass
- document.
-
-- ConstantBool, ConstantIntegral and ConstantInt
- classes have been merged together, we now just have
- ConstantInt.
-
-- Type::IntTy, Type::UIntTy, Type::SByteTy, ... are
- replaced by Type::Int8Ty, Type::Int16Ty, etc. LLVM types
- have always corresponded to fixed size types
- (e.g. long was always 64-bits), but the type system no longer includes
- information about the sign of the type. Also, the
- Type::isPrimitiveType() method now returns false for integers.
-
-- Several classes (CallInst, GetElementPtrInst,
- ConstantArray, etc), that once took std::vector as
- arguments now take ranges instead. For example, you can create a
- GetElementPtrInst with code like:
-
-
- Value *Ops[] = { Op1, Op2, Op3 };
- GEP = new GetElementPtrInst(BasePtr, Ops, 3);
-
-
- This avoids creation of a temporary vector (and a call to malloc/free). If
- you have an std::vector, use code like this:
-
- std::vector<Value*> Ops = ...;
- GEP = new GetElementPtrInst(BasePtr, &Ops[0], Ops.size());
-
-
-
-
-- CastInst is now abstract and its functionality is split into
- several parts, one for each of the new
- cast instructions.
-
-- Instruction::getNext()/getPrev() are now private (along with
- BasicBlock::getNext, etc), for efficiency reasons (they are now no
- longer just simple pointers). Please use BasicBlock::iterator, etc
- instead.
-
-
-- Module::getNamedFunction() is now called
- Module::getFunction().
-
-- SymbolTable.h has been split into ValueSymbolTable.h and
-TypeSymbolTable.h.
-
-
-
-
Portability and Supported Platforms
@@ -530,12 +348,11 @@ useful to some people. In particular, if you would like to work on one of these
components, please contact us on the
LLVMdev list.
-- The -cee pass is known to be buggy, and may be removed in in a
+
- The -cee pass is known to be buggy, and may be removed in a
future release.
-- C++ EH support is disabled for this release.
- The MSIL backend is experimental.
- The IA64 code generator is experimental.
-- The Alpha JIT is experimental.
+- The Alpha backend is experimental.
- "-filetype=asm" (the default) is the only supported value for the
-filetype llc option.
@@ -552,6 +369,9 @@ components, please contact us on the
inline
assembly that uses the X86 floating point stack.
+
The X86 backend occasionally has alignment
+ problems on operating systems that don't require 16-byte stack alignment
+ (including most non-darwin OS's like linux).
@@ -581,7 +401,7 @@ compilation, and lacks support for debug information.