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