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.1 Release Notes</title>
11 <h1>LLVM 3.1 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.1</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.1
35 <a href="http://llvm.org/releases/3.0/docs/ReleaseNotes.html">LLVM 3.0
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.1. 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.
50 All LLVM releases may be downloaded from
51 the <a href="http://llvm.org/releases/">LLVM 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.1 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
78 addition to this code, the LLVM Project includes other sub-projects that are
79 in development. Here we 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.1 time-frame, the Clang team has made many improvements:</p>
99 <li>C++11 support is greatly expanded including lambdas, initializer lists, constexpr, user-defined literals, and atomics.</li>
103 <p>For more details about the changes to Clang since the 2.9 release, see the
104 <a href="http://clang.llvm.org/docs/ReleaseNotes.html">Clang release notes</a>
108 <p>If Clang rejects your code but another compiler accepts it, please take a
109 look at the <a href="http://clang.llvm.org/compatibility.html">language
110 compatibility</a> guide to make sure this is not intentional or a known
115 <!--=========================================================================-->
117 <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.1 release has the following notable changes:</p>
133 <li>Partial support for gcc-4.7. Ada support is poor, but other languages work
136 <li>Support for ARM processors. Some essential gcc headers that are needed to
137 build DragonEgg for ARM are not installed by gcc. To work around this,
138 copy the missing headers from the gcc source tree.</li>
140 <li>Better optimization for Fortran by exploiting the fact that Fortran scalar
141 arguments have 'restrict' semantics.</li>
143 <li>Better optimization for all languages by passing information about type
144 aliasing and type ranges to the LLVM optimizers.</li>
146 <li>A regression test-suite was added.</li>
152 <!--=========================================================================-->
154 <a name="compiler-rt">compiler-rt: Compiler Runtime Library</a>
159 <p>The new LLVM <a href="http://compiler-rt.llvm.org/">compiler-rt project</a>
160 is a simple library that provides an implementation of the low-level
161 target-specific hooks required by code generation and other runtime
162 components. For example, when compiling for a 32-bit target, converting a
163 double to a 64-bit unsigned integer is compiled into a runtime call to the
164 "__fixunsdfdi" function. The compiler-rt library provides highly optimized
165 implementations of this and other low-level routines (some are 3x faster than
166 the equivalent libgcc routines).</p>
172 <!--=========================================================================-->
174 <a name="lldb">LLDB: Low Level Debugger</a>
179 <p>LLDB is a ground-up implementation of a command line debugger, as well as a
180 debugger API that can be used from other applications. LLDB makes use of the
181 Clang parser to provide high-fidelity expression parsing (particularly for
182 C++) and uses the LLVM JIT for target support.</p>
188 <!--=========================================================================-->
190 <a name="libc++">libc++: C++ Standard Library</a>
195 <p>Like compiler_rt, libc++ is now <a href="DeveloperPolicy.html#license">dual
196 licensed</a> under the MIT and UIUC license, allowing it to be used more
203 <!--=========================================================================-->
205 <a name="vmkit">VMKit</a>
210 <p>The <a href="http://vmkit.llvm.org/">VMKit project</a> is an
211 implementation of a Java Virtual Machine (Java VM or JVM) that uses LLVM for
212 static and just-in-time compilation.
214 <p>In the LLVM 3.1 time-frame, VMKit has had significant improvements on both
215 runtime and startup performance:</p>
224 <!--=========================================================================-->
226 <a name="Polly">Polly: Polyhedral Optimizer</a>
231 <p><a href="http://polly.llvm.org/">Polly</a> is an <em>experimental</em>
232 optimizer for data locality and parallelism. It currently provides high-level
233 loop optimizations and automatic parallelisation (using the OpenMP run time).
234 Work in the area of automatic SIMD and accelerator code generation was
237 <p>Within the LLVM 3.1 time-frame there were the following highlights:</p>
240 <li>Polly became an official LLVM project</li>
241 <li>Polly can be loaded directly into clang (Enabled by '-O3 -mllvm -polly'
243 <li>An automatic scheduling optimizer (derived from <a
244 href="http://pluto-compiler.sourceforge.net/">Pluto</a>) was integrated. It
245 performs loop transformations to optimize for data-locality and parallelism.
246 The transformations include, but are not limited to interchange, fusion,
247 fission, skewing and tiling.
255 <!-- *********************************************************************** -->
257 <a name="externalproj">External Open Source Projects Using LLVM 3.1</a>
259 <!-- *********************************************************************** -->
263 <p>An exciting aspect of LLVM is that it is used as an enabling technology for
264 a lot of other language and tools projects. This section lists some of the
265 projects that have already been updated to work with LLVM 3.1.</p>
267 <h3>Glasgow Haskell Compiler (GHC)</h3>
271 <p>GHC is an open source compiler and programming suite for Haskell, a lazy
272 functional programming language. It includes an optimizing static compiler
273 generating good code for a variety of platforms, together with an interactive
274 system for convenient, quick development.</p>
276 <p>GHC 7.0 and onwards include an LLVM code generator, supporting LLVM 2.8 and
285 <p><a href="http://pure-lang.googlecode.com/">Pure</a> is an
286 algebraic/functional programming language based on term rewriting. Programs
287 are collections of equations which are used to evaluate expressions in a
288 symbolic fashion. The interpreter uses LLVM as a backend to JIT-compile Pure
289 programs to fast native code. Pure offers dynamic typing, eager and lazy
290 evaluation, lexical closures, a hygienic macro system (also based on term
291 rewriting), built-in list and matrix support (including list and matrix
292 comprehensions) and an easy-to-use interface to C and other programming
293 languages (including the ability to load LLVM bitcode modules, and inline C,
294 C++, Fortran and Faust code in Pure programs if the corresponding
295 LLVM-enabled compilers are installed).</p>
297 <p>Pure version 0.54 has been tested and is known to work with LLVM 3.1 (and
298 continues to work with older LLVM releases >= 2.5).</p>
304 <!-- *********************************************************************** -->
306 <a name="whatsnew">What's New in LLVM 3.1?</a>
308 <!-- *********************************************************************** -->
312 <p>This release includes a huge number of bug fixes, performance tweaks and
313 minor improvements. Some of the major improvements and new features are
314 listed in this section.</p>
316 <!--=========================================================================-->
318 <a name="majorfeatures">Major New Features</a>
323 <!-- Features that need text if they're finished for 3.1:
327 loop dependence analysis
328 CorrelatedValuePropagation
329 lib/Transforms/IPO/MergeFunctions.cpp => consider for 3.1.
330 Integrated assembler on by default for arm/thumb?
335 Analysis/RegionInfo.h + Dom Frontiers
336 SparseBitVector: used in LiveVar.
337 llvm/lib/Archive - replace with lib object?
340 <p>LLVM 3.1 includes several major changes and big features:</p>
343 <li><a href="../tools/clang/docs/AddressSanitizer.html">AddressSanitizer</a>,
344 a fast memory error detector.</li>
345 <li><a href="CodeGenerator.html#machineinstrbundle">MachineInstr Bundles</a>,
346 Support to model instruction bundling / packing.</li>
347 <li><a href="#armintegratedassembler">ARM Integrated Assembler</a>,
348 A full featured assembler and direct-to-object support for ARM.</li>
349 <li><a href="#blockplacement">Basic Block Placement</a>
350 Probability driven basic block placement.</li>
357 <!--=========================================================================-->
359 <a name="coreimprovements">LLVM IR and Core Improvements</a>
364 <p>LLVM IR has several new features for better support of new targets and that
365 expose new optimization opportunities:</p>
368 <li>IR support for half float</li>
369 <li>IR support for vectors of pointers, including vector GEPs.</li>
370 <li>Module flags have been introduced. They convey information about the
371 module as a whole to LLVM subsystems.</li>
372 <li>Loads can now have range metadata attached to them to describe the
373 possible values being loaded.</li>
374 <li>Inline cost heuristics have been completely overhauled and now closely
375 model constant propagation through call sites, disregard trivially dead
376 code costs, and can model C++ STL iterator patterns.</li>
381 <!--=========================================================================-->
383 <a name="optimizer">Optimizer Improvements</a>
388 <p>In addition to many minor performance tweaks and bug fixes, this
389 release includes a few major enhancements and additions to the
393 <li>The loop unroll pass now is able to unroll loops with run-time trip counts.
394 This feature is turned off by default, and is enabled with the
395 <code>-unroll-runtime</code> flag.</li>
396 <li>A new basic-block autovectorization pass is available. Pass
397 <code>-vectorize</code> to run this pass along with some associated
398 post-vectorization cleanup passes. For more information, see the EuroLLVM
399 2012 slides: <a href="http://llvm.org/devmtg/2012-04-12/Slides/Hal_Finkel.pdf">
400 Autovectorization with LLVM</a>.</li>
406 <!--=========================================================================-->
408 <a name="mc">MC Level Improvements</a>
413 <p>The LLVM Machine Code (aka MC) subsystem was created to solve a number of
414 problems in the realm of assembly, disassembly, object file format handling,
415 and a number of other related areas that CPU instruction-set level tools work
416 in. For more information, please see
417 the <a href="http://blog.llvm.org/2010/04/intro-to-llvm-mc-project.html">Intro
418 to the LLVM MC Project Blog Post</a>.</p>
426 <!--=========================================================================-->
428 <a name="codegen">Target Independent Code Generator Improvements</a>
433 <p>We have changed the way that the Type Legalizer legalizes vectors. The type
434 legalizer now attempts to promote integer elements. This enabled the
435 implementation of vector-select. Additionally, we see a performance boost on
436 workloads which use vectors of chars and shorts, since they are now promoted
437 to 32-bit types, which are better supported by the SIMD instruction set.
438 Floating point types are still widened as before.</p>
441 <p>We have put a significant amount of work into the code generator
442 infrastructure, which allows us to implement more aggressive algorithms and
443 make it run faster:</p>
446 <li>TableGen can now synthesize register classes that are only needed to
447 represent combinations of constraints from instructions and sub-registers.
448 The synthetic register classes inherit most of their properties form their
449 closest user-defined super-class.</li>
450 <li><code>MachineRegisterInfo</code> now allows the reserved registers to be
451 frozen when register allocation starts. Target hooks should use the
452 <code>MRI->canReserveReg(FramePtr)</code> method to avoid accidentally
453 disabling frame pointer elimination during register allocation.</li>
454 <li>A new kind of <code>MachineOperand</code> provides a compact
455 representation of large clobber lists on call instructions. The register
456 mask operand references a bit mask of preserved registers. Everything else
460 <p> We added new TableGen infrastructure to support bundling for
461 Very Long Instruction Word (VLIW) architectures. TableGen can now
462 automatically generate a deterministic finite automaton from a VLIW
463 target's schedule description which can be queried to determine
464 legal groupings of instructions in a bundle.</p>
466 <p> We have added a new target independent VLIW packetizer based on the
467 DFA infrastructure to group machine instructions into bundles.</p>
472 <a name="blockplacement">Basic Block Placement</a>
475 <p>A probability based block placement and code layout algorithm was added to
476 LLVM's code generator. This layout pass supports probabilities derived from
477 static heuristics as well as source code annotations such as
478 <code>__builtin_expect</code>.</p>
481 <!--=========================================================================-->
483 <a name="x86">X86-32 and X86-64 Target Improvements</a>
488 <p>New features and major changes in the X86 target include:</p>
491 <li>Bug fixes and improved support for AVX1</li>
492 <li>Support for AVX2 (still incomplete at this point)</li>
493 <li>Call instructions use the new register mask operands for faster compile
494 times and better support for different calling conventions. The old WINCALL
495 instructions are no longer needed.</li>
496 <li>DW2 Exception Handling is enabled on Cygwin and MinGW.</li>
497 <li>Support for implicit TLS model used with MS VC runtime</li>
502 <!--=========================================================================-->
504 <a name="ARM">ARM Target Improvements</a>
509 <p>New features of the ARM target include:</p>
512 <li>The constant island pass now supports basic block and constant pool entry
513 alignments greater than 4 bytes.</li>
514 <li>On Darwin, the ARM target now has a full-featured integrated assembler.
519 <a name="armintegratedassembler">ARM Integrated Assembler</a>
522 <p>The ARM target now includes a full featured macro assembler, including
523 direct-to-object module support for clang. The assembler is currently enabled
524 by default for Darwin only pending testing and any additional necessary
525 platform specific support for Linux.</p>
527 <p>Full support is included for Thumb1, Thumb2 and ARM modes, along with
528 subtarget and CPU specific extensions for VFP2, VFP3 and NEON.</p>
530 <p>The assembler is Unified Syntax only (see ARM Architecural Reference Manual
531 for details). While there is some, and growing, support for pre-unfied (divided)
532 syntax, there are still significant gaps in that support.</p>
536 <!--=========================================================================-->
538 <a name="MIPS">MIPS Target Improvements</a>
543 <p>This release has seen major new work on just about every aspect of the MIPS
544 backend. Some of the major new features include:</p>
551 <!--=========================================================================-->
553 <a name="OtherTS">Other Target Specific Improvements</a>
558 <p>Support for Qualcomm's Hexagon VLIW processor has been added.</p>
568 <!--=========================================================================-->
570 <a name="changes">Major Changes and Removed Features</a>
575 <p>If you're already an LLVM user or developer with out-of-tree changes based on
576 LLVM 3.1, this section lists some "gotchas" that you may run into upgrading
577 from the previous release.</p>
580 <li>LLVM 3.1 removes support for reading LLVM 2.9 bitcode files. Going
581 forward, we aim for all future versions of LLVM to read bitcode files and
582 <tt>.ll</tt> files produced by LLVM 3.0 and later.</li>
583 <li>The <tt>unwind</tt> instruction is now gone. With the introduction of the
584 new exception handling system in LLVM 3.0, the <tt>unwind</tt> instruction
585 became obsolete.</li>
586 <li>LLVM 3.0 and earlier automatically added the returns_twice fo functions
587 like setjmp based on the name. This functionality was removed in 3.1.
588 This affects Clang users, if -ffreestanding is used.</li>
594 <!--=========================================================================-->
596 <a name="api_changes">Internal API Changes</a>
601 <p>In addition, many APIs have changed in this release. Some of the major
602 LLVM API changes are:</p>
605 <li>Target specific options have been moved from global variables to members
606 on the new <code>TargetOptions</code> class, which is local to each
607 <code>TargetMachine</code>. As a consequence, the associated flags will
608 no longer be accepted by <tt>clang -mllvm</tt>. This includes:
610 <li><code>llvm::PrintMachineCode</code></li>
611 <li><code>llvm::NoFramePointerElim</code></li>
612 <li><code>llvm::NoFramePointerElimNonLeaf</code></li>
613 <li><code>llvm::DisableFramePointerElim(const MachineFunction &)</code></li>
614 <li><code>llvm::LessPreciseFPMADOption</code></li>
615 <li><code>llvm::LessPrecideFPMAD()</code></li>
616 <li><code>llvm::NoExcessFPPrecision</code></li>
617 <li><code>llvm::UnsafeFPMath</code></li>
618 <li><code>llvm::NoInfsFPMath</code></li>
619 <li><code>llvm::NoNaNsFPMath</code></li>
620 <li><code>llvm::HonorSignDependentRoundingFPMathOption</code></li>
621 <li><code>llvm::HonorSignDependentRoundingFPMath()</code></li>
622 <li><code>llvm::UseSoftFloat</code></li>
623 <li><code>llvm::FloatABIType</code></li>
624 <li><code>llvm::NoZerosInBSS</code></li>
625 <li><code>llvm::JITExceptionHandling</code></li>
626 <li><code>llvm::JITEmitDebugInfo</code></li>
627 <li><code>llvm::JITEmitDebugInfoToDisk</code></li>
628 <li><code>llvm::GuaranteedTailCallOpt</code></li>
629 <li><code>llvm::StackAlignmentOverride</code></li>
630 <li><code>llvm::RealignStack</code></li>
631 <li><code>llvm::DisableJumpTables</code></li>
632 <li><code>llvm::EnableFastISel</code></li>
633 <li><code>llvm::getTrapFunctionName()</code></li>
634 <li><code>llvm::EnableSegmentedStacks</code></li>
636 <li>The MDBuilder class has been added to simplify the creation of
643 <!--=========================================================================-->
645 <a name="tools_changes">Tools Changes</a>
650 <p>In addition, some tools have changed in this release. Some of the changes
655 <li>llvm-stress is a command line tool for generating random .ll files to fuzz
656 different LLVM components. </li>
657 <li>llvm-ld has been removed. Use llvm-link or Clang instead.</li>
668 <!--=========================================================================-->
670 <a name="python">Python Bindings</a>
675 <p>Officially supported Python bindings have been added! Feature support is far
676 from complete. The current bindings support interfaces to:</p>
678 <li>Object File Interface</li>
679 <li>Disassembler</li>
682 <p>Using the Object File Interface, it is possible to inspect binary object files.
683 Think of it as a Python version of readelf or llvm-objdump.</p>
685 <p>Support for additional features is currently being developed by community
686 contributors. If you are interested in shaping the direction of the Python
687 bindings, please express your intent on IRC or the developers list.</p>
693 <!-- *********************************************************************** -->
695 <a name="knownproblems">Known Problems</a>
697 <!-- *********************************************************************** -->
701 <p>LLVM is generally a production quality compiler, and is used by a broad range
702 of applications and shipping in many products. That said, not every
703 subsystem is as mature as the aggregate, particularly the more obscure
704 targets. If you run into a problem, please check the <a
705 href="http://llvm.org/bugs/">LLVM bug database</a> and submit a bug if
706 there isn't already one or ask on the <a
707 href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev">LLVMdev
710 <p>Known problem areas include:</p>
713 <li>The Alpha, Blackfin, CellSPU, MSP430, PTX, SystemZ and
714 XCore backends are experimental, and the Alpha, Blackfin and SystemZ
715 targets have already been removed from mainline.</li>
717 <li>The integrated assembler, disassembler, and JIT is not supported by
718 several targets. If an integrated assembler is not supported, then a
719 system assembler is required. For more details, see the <a
720 href="CodeGenerator.html#targetfeatures">Target Features Matrix</a>.
723 <li>The C backend has numerous problems and is not being actively maintained.
724 Depending on it for anything serious is not advised.</li>
729 <!-- *********************************************************************** -->
731 <a name="additionalinfo">Additional Information</a>
733 <!-- *********************************************************************** -->
737 <p>A wide variety of additional information is available on
738 the <a href="http://llvm.org/">LLVM web page</a>, in particular in
739 the <a href="http://llvm.org/docs/">documentation</a> section. The web page
740 also contains versions of the API documentation which is up-to-date with the
741 Subversion version of the source code. You can access versions of these
742 documents specific to this release by going into the "<tt>llvm/doc/</tt>"
743 directory in the LLVM tree.</p>
745 <p>If you have any questions or comments about LLVM, please feel free to contact
746 us via the <a href="http://llvm.org/docs/#maillist"> mailing lists</a>.</p>
750 <!-- *********************************************************************** -->
754 <a href="http://jigsaw.w3.org/css-validator/check/referer"><img
755 src="http://jigsaw.w3.org/css-validator/images/vcss-blue" alt="Valid CSS"></a>
756 <a href="http://validator.w3.org/check/referer"><img
757 src="http://www.w3.org/Icons/valid-html401-blue" alt="Valid HTML 4.01"></a>
759 <a href="http://llvm.org/">LLVM Compiler Infrastructure</a><br>
760 Last modified: $Date$