This document contains the release notes for the LLVM compiler
infrastructure, release 1.5. Here we describe the status of LLVM, including any
known problems and major improvements from the previous release. The most
up-to-date version of this document can be found on the LLVM 1.5 web site. If you are
not reading this on the LLVM web pages, you should probably go there because
this document may be updated after the release.

Note that if you are reading this file from CVS 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.

LLVM 1.5 is known to correctly compile a wide range of C and C++ programs,
includes bug fixes for those problems found since the 1.4 release, and includes
a large number of new features and enhancements, described below.

This release includes new native code generators for Alpha, IA-64, and SPARC-V8 (32-bit SPARC). These code generators are still
beta quality, but are progressing rapidly. The Alpha backend is implemented
with an eye towards being compatible with the widely used SimpleScalar
simulator.

This release includes a new framework
for building instruction selectors, which has long been the hardest part of
building a new LLVM target. This framework handles a lot of the mundane (but
easy to get wrong) details of writing the instruction selector, such as
generating efficient code for getelementptr instructions, promoting
small integer types to larger types (e.g. for RISC targets with one size of
integer registers), expanding 64-bit integer operations for 32-bit targets, etc.
Currently, the X86, PowerPC, Alpha, and IA-64 backends use this framework. The
SPARC backends will be migrated when time permits.

LLVM 1.5 adds supports for per-function
calling conventions. Traditionally, the LLVM code generators match the
native C calling conventions for a target. This is important for compatibility,
but is not very flexible. This release allows custom calling conventions to be
established for functions, and defines three target-independent conventions (C call, fast call, and cold call) which may
be supported by code generators. When possible, the LLVM optimizer promotes C
functions to use the "fastcc" convention, allowing the use of more efficient
calling sequences (e.g., parameters are passed in registers in the X86 target).

The release now includes support for proper tail calls, as
required to implement languages like Scheme. Tail calls make use of two
features: custom calling conventions (described above), which allow the code
generator to use a convention where the caller deallocates its stack before it
returns. The second feature is a flag on the call
instruction, which indicates that the callee does not access the caller's
stack frame (indicating that it is acceptable to deallocate the caller stack
before invoking the callee). LLVM proper tail calls run on the system stack (as
do normal calls), supports indirect tail calls, tail calls with arbitrary
numbers of arguments, tail calls where the callee requires more argument space
than the caller, etc. The only case not supported are varargs calls, but that
could be added if desired.

To ensure a call is interpreted as a tail call, a front-end must mark
functions as "fastcc", mark calls with the 'tail' marker, and follow the call
with a return of the called value (or void). The optimizer and code generator
attempt to handle more general cases, but the simple case will always work if
the code generator supports tail calls. Here is an example:

In LLVM 1.5, the X86 code generator is the only target that has been enhanced
to support proper tail calls (other targets will be enhanced in future).
Further, because this support was added very close to the release, it is
disabled by default. Pass -enable-x86-fastcc to llc to enable it (this
will be enabled by default in the next release). The example above compiles to:

The new -simplify-libcalls pass improves code generated for well-known
library calls. The pass optimizes calls to many of the string, memory, and
standard I/O functions (e.g. replace the calls with simpler/faster calls) when
possible, given information known statically about the arguments to the call.

The -globalopt pass now promotes non-address-taken static globals that are
only accessed in main to SSA registers.

Intel and AMD machines running on Win32 with the Cygwin libraries (limited
support is available for native builds with Visual C++).

PowerPC-based Mac OS X systems, running 10.2 and above.

Alpha-based machines running Debian GNU/Linux.

Itanium-based machines running Linux and HP-UX.

The core LLVM infrastructure uses
GNU autoconf to adapt itself
to the machine and operating system on which it is built. However, minor
porting may be required to get LLVM to work on new platforms. We welcome your
portability patches and reports of successful builds or error messages.

This section contains all known problems with the LLVM system, listed by
component. As new problems are discovered, they will be added to these
sections. If you run into a problem, please check the LLVM bug database and submit a bug if
there isn't already one.

The following components of this LLVM release are either untested, known to
be broken or unreliable, or are in early development. These components should
not be relied on, and bugs should not be filed against them, but they may be
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 following passes are incomplete or buggy, and may be removed in future
releases: -cee, -branch-combine, -instloops, -paths, -pre

The llvm-db tool is in a very early stage of development, but can
be used to step through programs and inspect the stack.

The "iterative scan" register allocator (enabled with
-regalloc=iterativescan) is not stable.

The following GCC extensions are partially supported. An ignored
attribute means that the LLVM compiler ignores the presence of the attribute,
but the code should still work. An unsupported attribute is one which is
ignored by the LLVM compiler and will cause a different interpretation of
the program.

Variable Length:
Arrays whose length is computed at run time.
Supported, but allocated stack space is not freed until the function returns (noted above).

Other Builtins:
Other built-in functions.
We support all builtins which have a C language equivalent (e.g.,
__builtin_cos), __builtin_alloca,
__builtin_types_compatible_p, __builtin_choose_expr,
__builtin_constant_p, and __builtin_expect
(currently ignored). We also support builtins for ISO C99 floating
point comparison macros (e.g., __builtin_islessequal),
__builtin_prefetch, __builtin_popcount[ll],
__builtin_clz[ll], and __builtin_ctz[ll].

The C++ front-end is based on a pre-release of the GCC 3.4 C++ parser. This
parser is significantly more standards compliant (and picky) than prior GCC
versions. For more information, see the C++ section of the GCC 3.4 release notes.

Destructors for local objects are not always run when a longjmp is
performed. In particular, destructors for objects in the longjmping
function and in the setjmp receiver function may not be run.
Objects in intervening stack frames will be destroyed, however (which is
better than most compilers).

The LLVM C++ front-end follows the Itanium C++ ABI.
This document, which is not Itanium specific, specifies a standard for name
mangling, class layout, v-table layout, RTTI formats, and other C++
representation issues. Because we use this API, code generated by the LLVM
compilers should be binary compatible with machine code generated by other
Itanium ABI C++ compilers (such as G++, the Intel and HP compilers, etc).
However, the exception handling mechanism used by LLVM is very
different from the model used in the Itanium ABI, so exceptions will not
interact correctly.

On 21164s, some rare FP arithmetic sequences which may trap do not have the
appropriate nops inserted to ensure restartability.

Defining vararg functions is not supported (but calling them is ok).

Due to the vararg problems, C++ exceptions do not work. Small changes are required to the CFE (which break correctness in the exception handler) to compile the exception handling library (and thus the C++ standard library).

C++ programs are likely to fail on IA64, as calls to setjmp are
made where the argument is not 16-byte aligned, as required on IA64. (Strictly
speaking this is not a bug in the IA64 back-end; it will also be encountered
when building C++ programs using the C back-end.)

The C++ front-end does not use IA64
ABI compliant layout of v-tables. In particular, it just stores function
pointers instead of function descriptors in the vtable. This bug prevents
mixing C++ code compiled with LLVM with C++ objects compiled by other C++
compilers.

There are a few ABI violations which will lead to problems when mixing LLVM
output with code built with other compilers, particularly for floating-point
programs.