production-quality compiler for C, Objective-C, C++ and Objective-C++ on x86
(32- and 64-bit), and for Darwin/ARM targets.</p>
-<p>In the LLVM 3.0 time-frame, the Clang team has made many improvements:</p>
-
+<p>In the LLVM 3.0 time-frame, the Clang team has made many improvements:
<ul>
<li>Greatly improved support for building C++ applications, with greater
stability and better diagnostics.</li>
Objective-C runtime, or version 1.6 or later of the GNUstep Objective-C
runtime version.</li>
- <li>Improved support for OpenCL C, including the <tt>vec_step</tt> operator,
- address space qualifiers, improved vector literal support and code
- generation support for the <a href="#PTX">PTX target</a>.</li>
-
<li>Implemented a number of optimizations in <tt>libclang</tt>, the Clang C
interface, to improve the performance of code completion and the mapping
from source locations to abstract syntax tree nodes.</li>
</ul>
+For more details about the changes to Clang since the 2.9 release, see the
+<a href="http://clang.llvm.org/docs/ReleaseNotes.html">Clang release notes</a>
+</p>
<p>If Clang rejects your code but another compiler accepts it, please take a
<li>The <tt>-fplugin-arg-dragonegg-enable-gcc-optzns</tt> option, which runs
GCC's optimizers as well as LLVM's, now works much better. This is the
option to use if you want ultimate performance! It is still experimental
- though: it may cause the plugin to crash.</li>
+ though: it may cause the plugin to crash. Setting the optimization level
+ to <tt>-O4</tt> when using this option will optimize even harder, though
+ this usually doesn't result in any improvement over <tt>-O3</tt>.</li>
<li>The type and constant conversion logic has been almost entirely rewritten,
fixing a multitude of obscure bugs.</li>
</li>
<li>The LLVM IR exception handling representation has been redesigned and
reimplemented, making it more elegant, fixing a huge number of bugs, and
- enabling inlining and other optimizations. Please see its blog post (XXX
- not yet) and the <a href="ExceptionHandling.html">Exception Handling
+ enabling inlining and other optimizations. Please see its <a href=
+ "http://blog.llvm.org/2011/11/llvm-30-exception-handling-redesign.html">blog
+ post</a> and the <a href="ExceptionHandling.html">Exception Handling
documentation</a> for more information.</li>
<li>The LLVM IR Type system has been redesigned and reimplemented, making it
faster and solving some long-standing problems.
<li>A new <a href="LangRef.html#int_fma">llvm.fma intrinsic</a> directly
represents floating point multiply accumulate operations without an
intermediate rounding stage.</li>
- <li>A new llvm.expect intrinsic (XXX not documented in langref) allows a
- frontend to express expected control flow (and the __builtin_expect builtin
- from GNU C).</li>
+ <li>A new llvm.expect intrinsic allows a frontend to express expected control
+ flow (and the __builtin_expect builtin from GNU C).</li>
<li>The <a href="LangRef.html#int_prefetch">llvm.prefetch intrinsic</a> now
takes a 4th argument that specifies whether the prefetch happens from the
icache or dcache.</li>
make it run faster:</p>
<ul>
-<li>XXX: Segmented stacks.</li>
+<li>LLVM can now produce code that works with libgcc
+ to <a href="SegmentedStacks.html">dynamically allocate stack
+ segments</a>, as opposed to allocating a worst-case chunk of
+ virtual memory for each thread.</li>
<li>LLVM generates substantially better code for indirect gotos due to a new
tail duplication pass, which can be a substantial performance win for
interpreter loops that use them.</li>
-<li>Exception handling and debug information is now emitted with CFI directives,
- yielding <a href="http://blog.mozilla.com/respindola/2011/05/12/cfi-directives/">much smaller executables</a> for some C++ applications.
+<li>Exception handling and debug frame information is now emitted with CFI
+ directives. This lets the assembler produce more compact info as it knows
+ the final offsets, yielding <a href="http://blog.mozilla.com/respindola/2011/05/12/cfi-directives/">much smaller executables</a> for some C++ applications.
+ If the system assembler doesn't support it, MC exands the directives when
+ the integrated assembler is not used.
</li>
<li>The code generator now supports vector "select" operations on vector
pieces are texture/sampler support and some vector operations.</p>
<p>That said, the backend is already being used for domain-specific languages
- and works well with the <a href="http://www.pcc.me.uk/~peter/libclc/">libclc
- library</a> to supply OpenCL built-ins. With it, you can use Clang to compile
- OpenCL code into PTX and execute it by loading the resulting PTX as a binary
- blob using the nVidia OpenCL library. It has been tested with several OpenCL
- programs, including some from the nVidia GPU Computing SDK, and the performance
- is on par with the nVidia compiler.</p>
+ and can be used by Clang to
+ <a href="http://clang.llvm.org/docs/ReleaseNotes.html#opencl">compile OpenCL
+ C code</a> into PTX.</p>
</div>
aim for all future versions of LLVM to read bitcode files and .ll files
produced by LLVM 3.0.</li>
<li>Tablegen has been split into a library, allowing the clang tblgen pieces
- now live in the clang tree. The llvm version has been renamed to
+ to now live in the clang tree. The llvm version has been renamed to
llvm-tblgen instead of tblgen.</li>
<li>The <code>LLVMC</code> meta compiler driver was removed.</li>
<li>The unused PostOrder Dominator Frontiers and LowerSetJmp passes were removed.</li>
LLVM API changes are:</p>
<ul>
- <li>The biggest and most pervasive change is that llvm::Types are no longer
- returned or accepted as 'const' values. Instead, just pass around
- non-const Types.</li>
+ <li>The biggest and most pervasive change is that the type system has been
+ rewritten: <code>PATypeHolder</code> and <code>OpaqueType</code> are gone,
+ and all APIs deal with <code>Type*</code> instead of <code>const
+ Type*</code>. If you need to create recursive structures, then create a
+ named structure, and use <code>setBody()</code> when all its elements are
+ built. Type merging and refining is gone too: named structures are not
+ merged with other structures, even if their layout is identical. (of
+ course anonymous structures are still uniqued by layout).</li>
<li><code>PHINode::reserveOperandSpace</code> has been removed. Instead, you
must specify how many operands to reserve space for when you create the
use <code>DIBuilder::finalize()</code> at the end of translation unit to
complete debugging information encoding.</li>
- <li>The way the type system works has been
- rewritten: <code>PATypeHolder</code> and <code>OpaqueType</code> are gone,
- and all APIs deal with <code>Type*</code> instead of <code>const
- Type*</code>. If you need to create recursive structures, then create a
- named structure, and use <code>setBody()</code> when all its elements are
- built. Type merging and refining is gone too: named structures are not
- merged with other structures, even if their layout is identical. (of
- course anonymous structures are still uniqued by layout).</li>
-
<li>TargetSelect.h moved to Support/ from Target/</li>
<li>UpgradeIntrinsicCall no longer upgrades pre-2.9 intrinsic calls (for