blob: 9ddbbb765bfd46878c9461efbc0d7d3c9f915234 [file] [log] [blame]
Dmitri Gribenkoe17d8582012-12-09 23:14:26 +00001.. raw:: html
2
3 <style> .red {color:red} </style>
4
5.. role:: red
6
7======================
8LLVM 3.2 Release Notes
9======================
10
11.. contents::
12 :local:
13
14Written by the `LLVM Team <http://llvm.org/>`_
15
16:red:`These are in-progress notes for the upcoming LLVM 3.2 release. You may
17prefer the` `LLVM 3.1 Release Notes <http://llvm.org/releases/3.1/docs
18/ReleaseNotes.html>`_.
19
20Introduction
21============
22
23This document contains the release notes for the LLVM Compiler Infrastructure,
24release 3.2. Here we describe the status of LLVM, including major improvements
25from the previous release, improvements in various subprojects of LLVM, and
26some of the current users of the code. All LLVM releases may be downloaded
27from the `LLVM releases web site <http://llvm.org/releases/>`_.
28
29For more information about LLVM, including information about the latest
30release, please check out the `main LLVM web site <http://llvm.org/>`_. If you
31have questions or comments, the `LLVM Developer's Mailing List
32<http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev>`_ is a good place to send
33them.
34
35Note that if you are reading this file from a Subversion checkout or the main
36LLVM web page, this document applies to the *next* release, not the current
37one. To see the release notes for a specific release, please see the `releases
38page <http://llvm.org/releases/>`_.
39
40Sub-project Status Update
41=========================
42
43The LLVM 3.2 distribution currently consists of code from the core LLVM
44repository, which roughly includes the LLVM optimizers, code generators and
45supporting tools, and the Clang repository. In addition to this code, the LLVM
46Project includes other sub-projects that are in development. Here we include
47updates on these subprojects.
48
49Clang: C/C++/Objective-C Frontend Toolkit
50-----------------------------------------
51
52`Clang <http://clang.llvm.org/>`_ is an LLVM front end for the C, C++, and
53Objective-C languages. Clang aims to provide a better user experience through
54expressive diagnostics, a high level of conformance to language standards, fast
55compilation, and low memory use. Like LLVM, Clang provides a modular,
56library-based architecture that makes it suitable for creating or integrating
57with other development tools. Clang is considered a production-quality
58compiler for C, Objective-C, C++ and Objective-C++ on x86 (32- and 64-bit), and
59for Darwin/ARM targets.
60
61In the LLVM 3.2 time-frame, the Clang team has made many improvements.
62Highlights include:
63
Chandler Carruthd7407cd2012-12-14 13:22:57 +000064#. More powerful warnings, especially `-Wuninitialized`
65#. Template type diffing in diagnostic messages
66#. Higher quality and more efficient debug info generation
Dmitri Gribenkoe17d8582012-12-09 23:14:26 +000067
68For more details about the changes to Clang since the 3.1 release, see the
69`Clang release notes. <http://clang.llvm.org/docs/ReleaseNotes.html>`_
70
71If Clang rejects your code but another compiler accepts it, please take a look
72at the `language compatibility <http://clang.llvm.org/compatibility.html>`_
73guide to make sure this is not intentional or a known issue.
74
75DragonEgg: GCC front-ends, LLVM back-end
76----------------------------------------
77
78`DragonEgg <http://dragonegg.llvm.org/>`_ is a `gcc plugin
79<http://gcc.gnu.org/wiki/plugins>`_ that replaces GCC's optimizers and code
80generators with LLVM's. It works with gcc-4.5 and gcc-4.6 (and partially with
81gcc-4.7), can target the x86-32/x86-64 and ARM processor families, and has been
82successfully used on the Darwin, FreeBSD, KFreeBSD, Linux and OpenBSD
83platforms. It fully supports Ada, C, C++ and Fortran. It has partial support
84for Go, Java, Obj-C and Obj-C++.
85
86The 3.2 release has the following notable changes:
87
88#. ...
89
90compiler-rt: Compiler Runtime Library
91-------------------------------------
92
93The new LLVM `compiler-rt project <http://compiler-rt.llvm.org/>`_ is a simple
94library that provides an implementation of the low-level target-specific hooks
95required by code generation and other runtime components. For example, when
96compiling for a 32-bit target, converting a double to a 64-bit unsigned integer
97is compiled into a runtime call to the ``__fixunsdfdi`` function. The
98``compiler-rt`` library provides highly optimized implementations of this and
99other low-level routines (some are 3x faster than the equivalent libgcc
100routines).
101
102The 3.2 release has the following notable changes:
103
104#. ...
105
106LLDB: Low Level Debugger
107------------------------
108
109`LLDB <http://lldb.llvm.org>`_ is a ground-up implementation of a command line
110debugger, as well as a debugger API that can be used from other applications.
111LLDB makes use of the Clang parser to provide high-fidelity expression parsing
112(particularly for C++) and uses the LLVM JIT for target support.
113
114The 3.2 release has the following notable changes:
115
116#. ...
117
118libc++: C++ Standard Library
119----------------------------
120
121Like compiler_rt, libc++ is now :ref:`dual licensed
122<copyright-license-patents>` under the MIT and UIUC license, allowing it to be
123used more permissively.
124
125Within the LLVM 3.2 time-frame there were the following highlights:
126
127#. ...
128
129VMKit
130-----
131
132The `VMKit project <http://vmkit.llvm.org/>`_ is an implementation of a Java
133Virtual Machine (Java VM or JVM) that uses LLVM for static and just-in-time
134compilation.
135
136The 3.2 release has the following notable changes:
137
138#. ...
139
140Polly: Polyhedral Optimizer
141---------------------------
142
143`Polly <http://polly.llvm.org/>`_ is an *experimental* optimizer for data
144locality and parallelism. It provides high-level loop optimizations and
145automatic parallelisation.
146
147Within the LLVM 3.2 time-frame there were the following highlights:
148
149#. isl, the integer set library used by Polly, was relicensed to the MIT license
150#. isl based code generation
151#. MIT licensed replacement for CLooG (LGPLv2)
152#. Fine grained option handling (separation of core and border computations,
153 control overhead vs. code size)
154#. Support for FORTRAN and dragonegg
155#. OpenMP code generation fixes
156
157External Open Source Projects Using LLVM 3.2
158============================================
159
160An exciting aspect of LLVM is that it is used as an enabling technology for a
161lot of other language and tools projects. This section lists some of the
162projects that have already been updated to work with LLVM 3.2.
163
164Crack
165-----
166
167`Crack <http://code.google.com/p/crack-language/>`_ aims to provide the ease of
168development of a scripting language with the performance of a compiled
169language. The language derives concepts from C++, Java and Python,
170incorporating object-oriented programming, operator overloading and strong
171typing.
172
173FAUST
174-----
175
176`FAUST <http://faust.grame.fr/>`_ is a compiled language for real-time audio
177signal processing. The name FAUST stands for Functional AUdio STream. Its
178programming model combines two approaches: functional programming and block
179diagram composition. In addition with the C, C++, Java, JavaScript output
180formats, the Faust compiler can generate LLVM bitcode, and works with LLVM
1812.7-3.1.
182
183Glasgow Haskell Compiler (GHC)
184------------------------------
185
186`GHC <http://www.haskell.org/ghc/>`_ is an open source compiler and programming
187suite for Haskell, a lazy functional programming language. It includes an
188optimizing static compiler generating good code for a variety of platforms,
189together with an interactive system for convenient, quick development.
190
191GHC 7.0 and onwards include an LLVM code generator, supporting LLVM 2.8 and
192later.
193
194Julia
195-----
196
197`Julia <https://github.com/JuliaLang/julia>`_ is a high-level, high-performance
198dynamic language for technical computing. It provides a sophisticated
199compiler, distributed parallel execution, numerical accuracy, and an extensive
200mathematical function library. The compiler uses type inference to generate
201fast code without any type declarations, and uses LLVM's optimization passes
202and JIT compiler. The `Julia Language <http://julialang.org/>`_ is designed
203around multiple dispatch, giving programs a large degree of flexibility. It is
204ready for use on many kinds of problems.
205
206LLVM D Compiler
207---------------
208
209`LLVM D Compiler <https://github.com/ldc-developers/ldc>`_ (LDC) is a compiler
210for the D programming Language. It is based on the DMD frontend and uses LLVM
211as backend.
212
213Open Shading Language
214---------------------
215
216`Open Shading Language (OSL)
217<https://github.com/imageworks/OpenShadingLanguage/>`_ is a small but rich
218language for programmable shading in advanced global illumination renderers and
219other applications, ideal for describing materials, lights, displacement, and
220pattern generation. It uses LLVM to JIT complex shader networks to x86 code at
221runtime.
222
223OSL was developed by Sony Pictures Imageworks for use in its in-house renderer
224used for feature film animation and visual effects, and is distributed as open
225source software with the "New BSD" license.
226
227Portable OpenCL (pocl)
228----------------------
229
230In addition to producing an easily portable open source OpenCL implementation,
231another major goal of `pocl <http://pocl.sourceforge.net/>`_ is improving
232performance portability of OpenCL programs with compiler optimizations,
233reducing the need for target-dependent manual optimizations. An important part
234of pocl is a set of LLVM passes used to statically parallelize multiple
235work-items with the kernel compiler, even in the presence of work-group
236barriers. This enables static parallelization of the fine-grained static
237concurrency in the work groups in multiple ways (SIMD, VLIW, superscalar, ...).
238
239Pure
240----
241
242`Pure <http://pure-lang.googlecode.com/>`_ is an algebraic/functional
243programming language based on term rewriting. Programs are collections of
244equations which are used to evaluate expressions in a symbolic fashion. The
245interpreter uses LLVM as a backend to JIT-compile Pure programs to fast native
246code. Pure offers dynamic typing, eager and lazy evaluation, lexical closures,
247a hygienic macro system (also based on term rewriting), built-in list and
248matrix support (including list and matrix comprehensions) and an easy-to-use
249interface to C and other programming languages (including the ability to load
250LLVM bitcode modules, and inline C, C++, Fortran and Faust code in Pure
251programs if the corresponding LLVM-enabled compilers are installed).
252
253Pure version 0.54 has been tested and is known to work with LLVM 3.1 (and
254continues to work with older LLVM releases >= 2.5).
255
256TTA-based Co-design Environment (TCE)
257-------------------------------------
258
259`TCE <http://tce.cs.tut.fi/>`_ is a toolset for designing application-specific
260processors (ASP) based on the Transport triggered architecture (TTA). The
261toolset provides a complete co-design flow from C/C++ programs down to
262synthesizable VHDL/Verilog and parallel program binaries. Processor
263customization points include the register files, function units, supported
264operations, and the interconnection network.
265
266TCE uses Clang and LLVM for C/C++ language support, target independent
267optimizations and also for parts of code generation. It generates new
268LLVM-based code generators "on the fly" for the designed TTA processors and
269loads them in to the compiler backend as runtime libraries to avoid per-target
270recompilation of larger parts of the compiler chain.
271
272Installation Instructions
273=========================
274
275See :doc:`GettingStarted`.
276
277What's New in LLVM 3.2?
278=======================
279
280This release includes a huge number of bug fixes, performance tweaks and minor
281improvements. Some of the major improvements and new features are listed in
282this section.
283
284Major New Features
285------------------
286
287..
288
289 Features that need text if they're finished for 3.2:
290 ARM EHABI
291 combiner-aa?
292 strong phi elim
293 loop dependence analysis
294 CorrelatedValuePropagation
Dmitri Gribenkoe17d8582012-12-09 23:14:26 +0000295 Integrated assembler on by default for arm/thumb?
296
297 Near dead:
298 Analysis/RegionInfo.h + Dom Frontiers
299 SparseBitVector: used in LiveVar.
300 llvm/lib/Archive - replace with lib object?
301
302
303LLVM 3.2 includes several major changes and big features:
304
305#. New NVPTX back-end (replacing existing PTX back-end) based on NVIDIA sources
306#. ...
307
308LLVM IR and Core Improvements
309-----------------------------
310
311LLVM IR has several new features for better support of new targets and that
312expose new optimization opportunities:
313
314#. Thread local variables may have a specified TLS model. See the :ref:`Language
315 Reference Manual <globalvars>`.
316#. ...
317
318Optimizer Improvements
319----------------------
320
321In addition to many minor performance tweaks and bug fixes, this release
322includes a few major enhancements and additions to the optimizers:
323
324Loop Vectorizer - We've added a loop vectorizer and we are now able to
325vectorize small loops. The loop vectorizer is disabled by default and can be
326enabled using the ``-mllvm -vectorize-loops`` flag. The SIMD vector width can
327be specified using the flag ``-mllvm -force-vector-width=4``. The default
328value is ``0`` which means auto-select.
329
330We can now vectorize this function:
331
332.. code-block:: c++
333
334 unsigned sum_arrays(int *A, int *B, int start, int end) {
335 unsigned sum = 0;
336 for (int i = start; i < end; ++i)
337 sum += A[i] + B[i] + i;
338 return sum;
339 }
340
341We vectorize under the following loops:
342
343#. The inner most loops must have a single basic block.
344#. The number of iterations are known before the loop starts to execute.
345#. The loop counter needs to be incremented by one.
346#. The loop trip count **can** be a variable.
347#. Loops do **not** need to start at zero.
348#. The induction variable can be used inside the loop.
349#. Loop reductions are supported.
350#. Arrays with affine access pattern do **not** need to be marked as
351 '``noalias``' and are checked at runtime.
352#. ...
353
Chandler Carruthff038d72012-12-14 13:37:17 +0000354SROA - We've re-written SROA to be significantly more powerful and generate
355code which is much more friendly to the rest of the optimization pipeline.
356Previously this pass had scaling problems that required it to only operate on
357relatively small aggregates, and at times it would mistakenly replace a large
358aggregate with a single very large integer in order to make it a scalar SSA
359value. The result was a large number of i1024 and i2048 values representing any
360small stack buffer. These in turn slowed down many subsequent optimization
361paths.
362
363The new SROA pass uses a different algorithm that allows it to only promote to
364scalars the pieces of the aggregate actively in use. Because of this it doesn't
365require any thresholds. It also always deduces the scalar values from the uses
366of the aggregate rather than the specific LLVM type of the aggregate. These
367features combine to both optimize more code with the pass but to improve the
368compile time of many functions dramatically.
Dmitri Gribenkoe17d8582012-12-09 23:14:26 +0000369
370#. Branch weight metadata is preseved through more of the optimizer.
371#. ...
372
373MC Level Improvements
374---------------------
375
376The LLVM Machine Code (aka MC) subsystem was created to solve a number of
377problems in the realm of assembly, disassembly, object file format handling,
378and a number of other related areas that CPU instruction-set level tools work
379in. For more information, please see the `Intro to the LLVM MC Project Blog
380Post <http://blog.llvm.org/2010/04/intro-to-llvm-mc-project.html>`_.
381
382#. ...
383
384.. _codegen:
385
386Target Independent Code Generator Improvements
387----------------------------------------------
388
Dmitri Gribenkoe17d8582012-12-09 23:14:26 +0000389We have put a significant amount of work into the code generator
390infrastructure, which allows us to implement more aggressive algorithms and
391make it run faster:
392
393#. ...
394
395We added new TableGen infrastructure to support bundling for Very Long
396Instruction Word (VLIW) architectures. TableGen can now automatically generate
397a deterministic finite automaton from a VLIW target's schedule description
398which can be queried to determine legal groupings of instructions in a bundle.
399
400We have added a new target independent VLIW packetizer based on the DFA
401infrastructure to group machine instructions into bundles.
402
Chandler Carruth76292852012-12-14 13:37:18 +0000403Stack Coloring - We have implemented a new optimization pass to merge stack
404objects which are used in disjoin areas of the code. This optimization reduces
405the required stack space significantly, in cases where it is clear to the
406optimizer that the stack slot is not shared. We use the lifetime markers to
407tell the codegen that a certain alloca is used within a region.
408
409We now merge consecutive loads and stores.
410
Dmitri Gribenkoe17d8582012-12-09 23:14:26 +0000411Basic Block Placement
412^^^^^^^^^^^^^^^^^^^^^
413
414A probability based block placement and code layout algorithm was added to
415LLVM's code generator. This layout pass supports probabilities derived from
416static heuristics as well as source code annotations such as
417``__builtin_expect``.
418
419X86-32 and X86-64 Target Improvements
420-------------------------------------
421
422New features and major changes in the X86 target include:
423
424#. ...
425
426.. _ARM:
427
428ARM Target Improvements
429-----------------------
430
431New features of the ARM target include:
432
433#. ...
434
435.. _armintegratedassembler:
436
437ARM Integrated Assembler
438^^^^^^^^^^^^^^^^^^^^^^^^
439
440The ARM target now includes a full featured macro assembler, including
441direct-to-object module support for clang. The assembler is currently enabled
442by default for Darwin only pending testing and any additional necessary
443platform specific support for Linux.
444
445Full support is included for Thumb1, Thumb2 and ARM modes, along with subtarget
446and CPU specific extensions for VFP2, VFP3 and NEON.
447
448The assembler is Unified Syntax only (see ARM Architecural Reference Manual for
449details). While there is some, and growing, support for pre-unfied (divided)
450syntax, there are still significant gaps in that support.
451
452MIPS Target Improvements
453------------------------
454
455New features and major changes in the MIPS target include:
456
457#. ...
458
459PowerPC Target Improvements
460---------------------------
461
462Many fixes and changes across LLVM (and Clang) for better compliance with the
46364-bit PowerPC ELF Application Binary Interface, interoperability with GCC, and
464overall 64-bit PowerPC support. Some highlights include:
465
466#. MCJIT support added.
467#. PPC64 relocation support and (small code model) TOC handling added.
468#. Parameter passing and return value fixes (alignment issues, padding, varargs
469 support, proper register usage, odd-sized structure support, float support,
470 extension of return values for i32 return values).
471#. Fixes in spill and reload code for vector registers.
472#. C++ exception handling enabled.
473#. Changes to remediate double-rounding compatibility issues with respect to
474 GCC behavior.
475#. Refactoring to disentangle ``ppc64-elf-linux`` ABI from Darwin ppc64 ABI
476 support.
477#. Assorted new test cases and test case fixes (endian and word size issues).
478#. Fixes for big-endian codegen bugs, instruction encodings, and instruction
479 constraints.
480#. Implemented ``-integrated-as`` support.
481#. Additional support for Altivec compare operations.
482#. IBM long double support.
483
484There have also been code generation improvements for both 32- and 64-bit code.
485Instruction scheduling support for the Freescale e500mc and e5500 cores has
486been added.
487
488PTX/NVPTX Target Improvements
489-----------------------------
490
491The PTX back-end has been replaced by the NVPTX back-end, which is based on the
492LLVM back-end used by NVIDIA in their CUDA (nvcc) and OpenCL compiler. Some
493highlights include:
494
495#. Compatibility with PTX 3.1 and SM 3.5.
496#. Support for NVVM intrinsics as defined in the NVIDIA Compiler SDK.
497#. Full compatibility with old PTX back-end, with much greater coverage of LLVM
498 SIR.
499
500Please submit any back-end bugs to the LLVM Bugzilla site.
501
502Other Target Specific Improvements
503----------------------------------
504
505#. ...
506
507Major Changes and Removed Features
508----------------------------------
509
510If you're already an LLVM user or developer with out-of-tree changes based on
511LLVM 3.2, this section lists some "gotchas" that you may run into upgrading
512from the previous release.
513
514#. The CellSPU port has been removed. It can still be found in older versions.
515#. ...
516
517Internal API Changes
518--------------------
519
520In addition, many APIs have changed in this release. Some of the major LLVM
521API changes are:
522
523We've added a new interface for allowing IR-level passes to access
524target-specific information. A new IR-level pass, called
525``TargetTransformInfo`` provides a number of low-level interfaces. LSR and
526LowerInvoke already use the new interface.
527
528The ``TargetData`` structure has been renamed to ``DataLayout`` and moved to
529``VMCore`` to remove a dependency on ``Target``.
530
531#. ...
532
533Tools Changes
534-------------
535
536In addition, some tools have changed in this release. Some of the changes are:
537
538#. ...
539
540Python Bindings
541---------------
542
543Officially supported Python bindings have been added! Feature support is far
544from complete. The current bindings support interfaces to:
545
546#. ...
547
548Known Problems
549==============
550
551LLVM is generally a production quality compiler, and is used by a broad range
552of applications and shipping in many products. That said, not every subsystem
553is as mature as the aggregate, particularly the more obscure1 targets. If you
554run into a problem, please check the `LLVM bug database
555<http://llvm.org/bugs/>`_ and submit a bug if there isn't already one or ask on
556the `LLVMdev list <http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev>`_.
557
558Known problem areas include:
559
560#. The CellSPU, MSP430, and XCore backends are experimental.
561
562#. The integrated assembler, disassembler, and JIT is not supported by several
563 targets. If an integrated assembler is not supported, then a system
564 assembler is required. For more details, see the
565 :ref:`target-feature-matrix`.
566
567Additional Information
568======================
569
570A wide variety of additional information is available on the `LLVM web page
571<http://llvm.org/>`_, in particular in the `documentation
572<http://llvm.org/docs/>`_ section. The web page also contains versions of the
573API documentation which is up-to-date with the Subversion version of the source
574code. You can access versions of these documents specific to this release by
575going into the ``llvm/docs/`` directory in the LLVM tree.
576
577If you have any questions or comments about LLVM, please feel free to contact
578us via the `mailing lists <http://llvm.org/docs/#maillist>`_.
579