1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
2 "http://www.w3.org/TR/html4/strict.dtd">
5 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
6 <link rel="stylesheet" href="_static/llvm.css" type="text/css">
7 <title>LLVM 3.2 Release Notes</title>
11 <h1>LLVM 3.2 Release Notes</h1>
14 <img style="float:right" src="http://llvm.org/img/DragonSmall.png"
15 width="136" height="136" alt="LLVM Dragon Logo">
19 <li><a href="#intro">Introduction</a></li>
20 <li><a href="#subproj">Sub-project Status Update</a></li>
21 <li><a href="#externalproj">External Projects Using LLVM 3.2</a></li>
22 <li><a href="#whatsnew">What's New in LLVM?</a></li>
23 <li><a href="GettingStarted.html">Installation Instructions</a></li>
24 <li><a href="#knownproblems">Known Problems</a></li>
25 <li><a href="#additionalinfo">Additional Information</a></li>
28 <div class="doc_author">
29 <p>Written by the <a href="http://llvm.org/">LLVM Team</a></p>
32 <h1 style="color:red">These are in-progress notes for the upcoming LLVM 3.2
35 <a href="http://llvm.org/releases/3.1/docs/ReleaseNotes.html">LLVM 3.1
36 Release Notes</a>.</h1>
38 <!-- *********************************************************************** -->
40 <a name="intro">Introduction</a>
42 <!-- *********************************************************************** -->
46 <p>This document contains the release notes for the LLVM Compiler
47 Infrastructure, release 3.2. Here we describe the status of LLVM, including
48 major improvements from the previous release, improvements in various
49 subprojects of LLVM, and some of the current users of the code. All LLVM
50 releases may be downloaded from the <a href="http://llvm.org/releases/">LLVM
51 releases web site</a>.</p>
53 <p>For more information about LLVM, including information about the latest
54 release, please check out the <a href="http://llvm.org/">main LLVM web
55 site</a>. If you have questions or comments,
56 the <a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev">LLVM
57 Developer's Mailing List</a> is a good place to send them.</p>
59 <p>Note that if you are reading this file from a Subversion checkout or the main
60 LLVM web page, this document applies to the <i>next</i> release, not the
61 current one. To see the release notes for a specific release, please see the
62 <a href="http://llvm.org/releases/">releases page</a>.</p>
67 <!-- *********************************************************************** -->
69 <a name="subproj">Sub-project Status Update</a>
71 <!-- *********************************************************************** -->
75 <p>The LLVM 3.2 distribution currently consists of code from the core LLVM
76 repository, which roughly includes the LLVM optimizers, code generators and
77 supporting tools, and the Clang repository. In addition to this code, the
78 LLVM Project includes other sub-projects that are in development. Here we
79 include updates on these subprojects.</p>
81 <!--=========================================================================-->
83 <a name="clang">Clang: C/C++/Objective-C Frontend Toolkit</a>
88 <p><a href="http://clang.llvm.org/">Clang</a> is an LLVM front end for the C,
89 C++, and Objective-C languages. Clang aims to provide a better user
90 experience through expressive diagnostics, a high level of conformance to
91 language standards, fast compilation, and low memory use. Like LLVM, Clang
92 provides a modular, library-based architecture that makes it suitable for
93 creating or integrating with other development tools. Clang is considered a
94 production-quality compiler for C, Objective-C, C++ and Objective-C++ on x86
95 (32- and 64-bit), and for Darwin/ARM targets.</p>
97 <p>In the LLVM 3.2 time-frame, the Clang team has made many improvements.
98 Highlights include:</p>
103 <p>For more details about the changes to Clang since the 3.1 release, see the
104 <a href="http://clang.llvm.org/docs/ReleaseNotes.html">Clang release
107 <p>If Clang rejects your code but another compiler accepts it, please take a
108 look at the <a href="http://clang.llvm.org/compatibility.html">language
109 compatibility</a> guide to make sure this is not intentional or a known
114 <!--=========================================================================-->
116 <a name="dragonegg">DragonEgg: GCC front-ends, LLVM back-end</a>
121 <p><a href="http://dragonegg.llvm.org/">DragonEgg</a> is a
122 <a href="http://gcc.gnu.org/wiki/plugins">gcc plugin</a> that replaces GCC's
123 optimizers and code generators with LLVM's. It works with gcc-4.5 and gcc-4.6
124 (and partially with gcc-4.7), can target the x86-32/x86-64 and ARM processor
125 families, and has been successfully used on the Darwin, FreeBSD, KFreeBSD,
126 Linux and OpenBSD platforms. It fully supports Ada, C, C++ and Fortran. It
127 has partial support for Go, Java, Obj-C and Obj-C++.</p>
129 <p>The 3.2 release has the following notable changes:</p>
137 <!--=========================================================================-->
139 <a name="compiler-rt">compiler-rt: Compiler Runtime Library</a>
144 <p>The new LLVM <a href="http://compiler-rt.llvm.org/">compiler-rt project</a>
145 is a simple library that provides an implementation of the low-level
146 target-specific hooks required by code generation and other runtime
147 components. For example, when compiling for a 32-bit target, converting a
148 double to a 64-bit unsigned integer is compiled into a runtime call to the
149 <code>__fixunsdfdi</code> function. The compiler-rt library provides highly
150 optimized implementations of this and other low-level routines (some are 3x
151 faster than the equivalent libgcc routines).</p>
153 <p>The 3.2 release has the following notable changes:</p>
161 <!--=========================================================================-->
163 <a name="lldb">LLDB: Low Level Debugger</a>
168 <p><a href="http://lldb.llvm.org">LLDB</a> is a ground-up implementation of a
169 command line debugger, as well as a debugger API that can be used from other
170 applications. LLDB makes use of the Clang parser to provide high-fidelity
171 expression parsing (particularly for C++) and uses the LLVM JIT for target
174 <p>The 3.2 release has the following notable changes:</p>
182 <!--=========================================================================-->
184 <a name="libc++">libc++: C++ Standard Library</a>
189 <p>Like compiler_rt, libc++ is now <a href="DeveloperPolicy.html#license">dual
190 licensed</a> under the MIT and UIUC license, allowing it to be used more
193 <p>Within the LLVM 3.2 time-frame there were the following highlights:</p>
201 <!--=========================================================================-->
203 <a name="vmkit">VMKit</a>
208 <p>The <a href="http://vmkit.llvm.org/">VMKit project</a> is an implementation
209 of a Java Virtual Machine (Java VM or JVM) that uses LLVM for static and
210 just-in-time compilation.</p>
212 <p>The 3.2 release has the following notable changes:</p>
221 <!--=========================================================================-->
223 <a name="Polly">Polly: Polyhedral Optimizer</a>
228 <p><a href="http://polly.llvm.org/">Polly</a> is an <em>experimental</em>
229 optimizer for data locality and parallelism. It provides high-level
230 loop optimizations and automatic parallelisation.</p>
232 <p>Within the LLVM 3.2 time-frame there were the following highlights:</p>
235 <li>isl, the integer set library used by Polly, was relicensed to the MIT
237 <li>isl based code generation<br />
239 <li>MIT licensed replacement for CLooG (LGPLv2) </li>
240 <li>Fine grained option handling (separation of
241 core and border computations, control overhead vs. code size) </li>
244 <li>Support for FORTRAN and dragonegg</li>
245 <li>OpenMP code generation fixes</li>
253 <!-- *********************************************************************** -->
255 <a name="externalproj">External Open Source Projects Using LLVM 3.2</a>
257 <!-- *********************************************************************** -->
261 <p>An exciting aspect of LLVM is that it is used as an enabling technology for
262 a lot of other language and tools projects. This section lists some of the
263 projects that have already been updated to work with LLVM 3.2.</p>
269 <p><a href="http://code.google.com/p/crack-language/">Crack</a> aims to provide
270 the ease of development of a scripting language with the performance of a
271 compiled language. The language derives concepts from C++, Java and Python,
272 incorporating object-oriented programming, operator overloading and strong
281 <p><a href="http://faust.grame.fr/">FAUST</a> is a compiled language for
282 real-time audio signal processing. The name FAUST stands for Functional
283 AUdio STream. Its programming model combines two approaches: functional
284 programming and block diagram composition. In addition with the C, C++, Java,
285 JavaScript output formats, the Faust compiler can generate LLVM bitcode, and
286 works with LLVM 2.7-3.1.</p>
290 <h3>Glasgow Haskell Compiler (GHC)</h3>
294 <p><a href="http://www.haskell.org/ghc/">GHC</a> is an open source compiler and
295 programming suite for Haskell, a lazy functional programming language. It
296 includes an optimizing static compiler generating good code for a variety of
297 platforms, together with an interactive system for convenient, quick
300 <p>GHC 7.0 and onwards include an LLVM code generator, supporting LLVM 2.8 and
309 <p><a href="https://github.com/JuliaLang/julia">Julia</a> is a high-level,
310 high-performance dynamic language for technical computing. It provides a
311 sophisticated compiler, distributed parallel execution, numerical accuracy,
312 and an extensive mathematical function library. The compiler uses type
313 inference to generate fast code without any type declarations, and uses
314 LLVM's optimization passes and JIT compiler. The
315 <a href="http://julialang.org/"> Julia Language</a> is designed
316 around multiple dispatch, giving programs a large degree of flexibility. It
317 is ready for use on many kinds of problems.</p>
321 <h3>LLVM D Compiler</h3>
325 <p><a href="https://github.com/ldc-developers/ldc">LLVM D Compiler</a> (LDC) is
326 a compiler for the D programming Language. It is based on the DMD frontend
327 and uses LLVM as backend.</p>
331 <h3>Open Shading Language</h3>
335 <p><a href="https://github.com/imageworks/OpenShadingLanguage/">Open Shading
336 Language (OSL)</a> is a small but rich language for programmable shading in
337 advanced global illumination renderers and other applications, ideal for
338 describing materials, lights, displacement, and pattern generation. It uses
339 LLVM to JIT complex shader networks to x86 code at runtime.</p>
341 <p>OSL was developed by Sony Pictures Imageworks for use in its in-house
342 renderer used for feature film animation and visual effects, and is
343 distributed as open source software with the "New BSD" license.</p>
347 <h3>Portable OpenCL (pocl)</h3>
351 <p>In addition to producing an easily portable open source OpenCL
352 implementation, another major goal of <a href="http://pocl.sourceforge.net/">
353 pocl</a> is improving performance portability of OpenCL programs with
354 compiler optimizations, reducing the need for target-dependent manual
355 optimizations. An important part of pocl is a set of LLVM passes used to
356 statically parallelize multiple work-items with the kernel compiler, even in
357 the presence of work-group barriers. This enables static parallelization of
358 the fine-grained static concurrency in the work groups in multiple ways
359 (SIMD, VLIW, superscalar,...).</p>
367 <p><a href="http://pure-lang.googlecode.com/">Pure</a> is an
368 algebraic/functional programming language based on term rewriting. Programs
369 are collections of equations which are used to evaluate expressions in a
370 symbolic fashion. The interpreter uses LLVM as a backend to JIT-compile Pure
371 programs to fast native code. Pure offers dynamic typing, eager and lazy
372 evaluation, lexical closures, a hygienic macro system (also based on term
373 rewriting), built-in list and matrix support (including list and matrix
374 comprehensions) and an easy-to-use interface to C and other programming
375 languages (including the ability to load LLVM bitcode modules, and inline C,
376 C++, Fortran and Faust code in Pure programs if the corresponding
377 LLVM-enabled compilers are installed).</p>
379 <p>Pure version 0.54 has been tested and is known to work with LLVM 3.1 (and
380 continues to work with older LLVM releases >= 2.5).</p>
384 <h3>TTA-based Co-design Environment (TCE)</h3>
388 <p><a href="http://tce.cs.tut.fi/">TCE</a> is a toolset for designing
389 application-specific processors (ASP) based on the Transport triggered
390 architecture (TTA). The toolset provides a complete co-design flow from C/C++
391 programs down to synthesizable VHDL/Verilog and parallel program binaries.
392 Processor customization points include the register files, function units,
393 supported operations, and the interconnection network.</p>
395 <p>TCE uses Clang and LLVM for C/C++ language support, target independent
396 optimizations and also for parts of code generation. It generates new
397 LLVM-based code generators "on the fly" for the designed TTA processors and
398 loads them in to the compiler backend as runtime libraries to avoid
399 per-target recompilation of larger parts of the compiler chain.</p>
405 <!-- *********************************************************************** -->
407 <a name="whatsnew">What's New in LLVM 3.2?</a>
409 <!-- *********************************************************************** -->
413 <p>This release includes a huge number of bug fixes, performance tweaks and
414 minor improvements. Some of the major improvements and new features are
415 listed in this section.</p>
417 <!--=========================================================================-->
419 <a name="majorfeatures">Major New Features</a>
424 <!-- Features that need text if they're finished for 3.2:
428 loop dependence analysis
429 CorrelatedValuePropagation
430 lib/Transforms/IPO/MergeFunctions.cpp => consider for 3.2.
431 Integrated assembler on by default for arm/thumb?
436 Analysis/RegionInfo.h + Dom Frontiers
437 SparseBitVector: used in LiveVar.
438 llvm/lib/Archive - replace with lib object?
441 <p>LLVM 3.2 includes several major changes and big features:</p>
450 <!--=========================================================================-->
452 <a name="coreimprovements">LLVM IR and Core Improvements</a>
457 <p>LLVM IR has several new features for better support of new targets and that
458 expose new optimization opportunities:</p>
461 <li>Thread local variables may have a specified TLS model. See the
462 <a href="LangRef.html#globalvars">Language Reference Manual</a>.</li>
468 <!--=========================================================================-->
470 <a name="optimizer">Optimizer Improvements</a>
475 <p>In addition to many minor performance tweaks and bug fixes, this release
476 includes a few major enhancements and additions to the optimizers:</p>
478 <p> Loop Vectorizer - We've added a loop vectorizer and we are now able to
479 vectorize small loops. The loop vectorizer is disabled by default and
480 can be enabled using the <b>-mllvm -vectorize-loops</b> flag.
481 The SIMD vector width can be specified using the flag
482 <b>-mllvm -force-vector-width=4</b>.
483 The default value is <b>0</b> which means auto-select.
485 We can now vectorize this function:
487 <pre class="doc_code">
488 unsigned sum_arrays(int *A, int *B, int start, int end) {
490 for (int i = start; i < end; ++i)
491 sum += A[i] + B[i] + i;
497 We vectorize under the following loops:
499 <li>The inner most loops must have a single basic block.</li>
500 <li>The number of iterations are known before the loop starts to execute.</li>
501 <li>The loop counter needs to be incremented by one.</li>
502 <li>The loop trip count <b>can</b> be a variable.</li>
503 <li>Loops do <b>not</b> need to start at zero.</li>
504 <li>The induction variable can be used inside the loop.</li>
505 <li>Loop reductions are supported.</li>
506 <li>Arrays with affine access pattern do <b>not</b> need to be marked as 'noalias' and are checked at runtime.</li>
512 <p>SROA - We've re-written SROA to be significantly more powerful.
513 <!-- FIXME: Add more text here... --></p>
516 <li>Branch weight metadata is preseved through more of the optimizer.</li>
522 <!--=========================================================================-->
524 <a name="mc">MC Level Improvements</a>
529 <p>The LLVM Machine Code (aka MC) subsystem was created to solve a number of
530 problems in the realm of assembly, disassembly, object file format handling,
531 and a number of other related areas that CPU instruction-set level tools work
532 in. For more information, please see the
533 <a href="http://blog.llvm.org/2010/04/intro-to-llvm-mc-project.html">Intro
534 to the LLVM MC Project Blog Post</a>.</p>
542 <!--=========================================================================-->
544 <a name="codegen">Target Independent Code Generator Improvements</a>
549 <p>Stack Coloring - We have implemented a new optimization pass
550 to merge stack objects which are used in disjoin areas of the code.
551 This optimization reduces the required stack space significantly, in cases
552 where it is clear to the optimizer that the stack slot is not shared.
553 We use the lifetime markers to tell the codegen that a certain alloca
554 is used within a region.</p>
556 <p> We now merge consecutive loads and stores. </p>
558 <p>We have put a significant amount of work into the code generator
559 infrastructure, which allows us to implement more aggressive algorithms and
560 make it run faster:</p>
566 <p> We added new TableGen infrastructure to support bundling for
567 Very Long Instruction Word (VLIW) architectures. TableGen can now
568 automatically generate a deterministic finite automaton from a VLIW
569 target's schedule description which can be queried to determine
570 legal groupings of instructions in a bundle.</p>
572 <p> We have added a new target independent VLIW packetizer based on the
573 DFA infrastructure to group machine instructions into bundles.</p>
578 <a name="blockplacement">Basic Block Placement</a>
583 <p>A probability based block placement and code layout algorithm was added to
584 LLVM's code generator. This layout pass supports probabilities derived from
585 static heuristics as well as source code annotations such as
586 <code>__builtin_expect</code>.</p>
590 <!--=========================================================================-->
592 <a name="x86">X86-32 and X86-64 Target Improvements</a>
597 <p>New features and major changes in the X86 target include:</p>
605 <!--=========================================================================-->
607 <a name="ARM">ARM Target Improvements</a>
612 <p>New features of the ARM target include:</p>
618 <!--_________________________________________________________________________-->
621 <a name="armintegratedassembler">ARM Integrated Assembler</a>
626 <p>The ARM target now includes a full featured macro assembler, including
627 direct-to-object module support for clang. The assembler is currently enabled
628 by default for Darwin only pending testing and any additional necessary
629 platform specific support for Linux.</p>
631 <p>Full support is included for Thumb1, Thumb2 and ARM modes, along with
632 subtarget and CPU specific extensions for VFP2, VFP3 and NEON.</p>
634 <p>The assembler is Unified Syntax only (see ARM Architecural Reference Manual
635 for details). While there is some, and growing, support for pre-unfied
636 (divided) syntax, there are still significant gaps in that support.</p>
642 <!--=========================================================================-->
644 <a name="MIPS">MIPS Target Improvements</a>
649 <p>New features and major changes in the MIPS target include:</p>
657 <!--=========================================================================-->
659 <a name="PowerPC">PowerPC Target Improvements</a>
665 <p>Many fixes and changes across LLVM (and Clang) for better compliance with
666 the 64-bit PowerPC ELF Application Binary Interface, interoperability with
667 GCC, and overall 64-bit PowerPC support. Some highlights include:</p>
669 <li> MCJIT support added.</li>
670 <li> PPC64 relocation support and (small code model) TOC handling
672 <li> Parameter passing and return value fixes (alignment issues,
673 padding, varargs support, proper register usage, odd-sized
674 structure support, float support, extension of return values
675 for i32 return values).</li>
676 <li> Fixes in spill and reload code for vector registers.</li>
677 <li> C++ exception handling enabled.</li>
678 <li> Changes to remediate double-rounding compatibility issues with
679 respect to GCC behavior.</li>
680 <li> Refactoring to disentangle ppc64-elf-linux ABI from Darwin
681 ppc64 ABI support.</li>
682 <li> Assorted new test cases and test case fixes (endian and word
684 <li> Fixes for big-endian codegen bugs, instruction encodings, and
685 instruction constraints.</li>
686 <li> Implemented -integrated-as support.</li>
687 <li> Additional support for Altivec compare operations.</li>
688 <li> IBM long double support.</li>
690 <p>There have also been code generation improvements for both 32- and 64-bit
691 code. Instruction scheduling support for the Freescale e500mc and e5500
692 cores has been added.</p>
697 <!--=========================================================================-->
699 <a name="OtherTS">Other Target Specific Improvements</a>
710 <!--=========================================================================-->
712 <a name="changes">Major Changes and Removed Features</a>
717 <p>If you're already an LLVM user or developer with out-of-tree changes based on
718 LLVM 3.2, this section lists some "gotchas" that you may run into upgrading
719 from the previous release.</p>
722 <li>The CellSPU port has been removed. It can still be found in older
729 <!--=========================================================================-->
731 <a name="api_changes">Internal API Changes</a>
736 <p>In addition, many APIs have changed in this release. Some of the major
737 LLVM API changes are:</p>
739 <p> We've added a new interface for allowing IR-level passes to access
740 target-specific information. A new IR-level pass, called
741 "TargetTransformInfo" provides a number of low-level interfaces.
742 LSR and LowerInvoke already use the new interface. </p>
744 <p> The TargetData structure has been renamed to DataLayout and moved to VMCore
745 to remove a dependency on Target. </p>
753 <!--=========================================================================-->
755 <a name="tools_changes">Tools Changes</a>
760 <p>In addition, some tools have changed in this release. Some of the changes
770 <!--=========================================================================-->
772 <a name="python">Python Bindings</a>
777 <p>Officially supported Python bindings have been added! Feature support is far
778 from complete. The current bindings support interfaces to:</p>
788 <!-- *********************************************************************** -->
790 <a name="knownproblems">Known Problems</a>
792 <!-- *********************************************************************** -->
796 <p>LLVM is generally a production quality compiler, and is used by a broad range
797 of applications and shipping in many products. That said, not every
798 subsystem is as mature as the aggregate, particularly the more obscure
799 targets. If you run into a problem, please check
800 the <a href="http://llvm.org/bugs/">LLVM bug database</a> and submit a bug if
801 there isn't already one or ask on
802 the <a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev">LLVMdev
805 <p>Known problem areas include:</p>
808 <li>The CellSPU, MSP430, PTX and XCore backends are experimental.</li>
810 <li>The integrated assembler, disassembler, and JIT is not supported by
811 several targets. If an integrated assembler is not supported, then a
812 system assembler is required. For more details, see the <a
813 href="CodeGenerator.html#targetfeatures">Target Features Matrix</a>.
819 <!-- *********************************************************************** -->
821 <a name="additionalinfo">Additional Information</a>
823 <!-- *********************************************************************** -->
827 <p>A wide variety of additional information is available on
828 the <a href="http://llvm.org/">LLVM web page</a>, in particular in
829 the <a href="http://llvm.org/docs/">documentation</a> section. The web page
830 also contains versions of the API documentation which is up-to-date with the
831 Subversion version of the source code. You can access versions of these
832 documents specific to this release by going into the "<tt>llvm/doc/</tt>"
833 directory in the LLVM tree.</p>
835 <p>If you have any questions or comments about LLVM, please feel free to contact
836 us via the <a href="http://llvm.org/docs/#maillist"> mailing lists</a>.</p>
840 <!-- *********************************************************************** -->
844 <a href="http://jigsaw.w3.org/css-validator/check/referer"><img
845 src="http://jigsaw.w3.org/css-validator/images/vcss-blue" alt="Valid CSS"></a>
846 <a href="http://validator.w3.org/check/referer"><img
847 src="http://www.w3.org/Icons/valid-html401-blue" alt="Valid HTML 4.01"></a>
849 <a href="http://llvm.org/">LLVM Compiler Infrastructure</a><br>
850 Last modified: $Date$