ReleaseNotes: C API policy; by Eric Christopher
[oota-llvm.git] / docs / ReleaseNotes.rst
1 ======================
2 LLVM 3.8 Release Notes
3 ======================
4
5 .. contents::
6     :local:
7
8
9 Introduction
10 ============
11
12 This document contains the release notes for the LLVM Compiler Infrastructure,
13 release 3.8.  Here we describe the status of LLVM, including major improvements
14 from the previous release, improvements in various subprojects of LLVM, and
15 some of the current users of the code.  All LLVM releases may be downloaded
16 from the `LLVM releases web site <http://llvm.org/releases/>`_.
17
18 For more information about LLVM, including information about the latest
19 release, please check out the `main LLVM web site <http://llvm.org/>`_.  If you
20 have questions or comments, the `LLVM Developer's Mailing List
21 <http://lists.llvm.org/mailman/listinfo/llvm-dev>`_ is a good place to send
22 them.
23
24 Non-comprehensive list of changes in this release
25 =================================================
26 * With this release, the minimum Windows version required for running LLVM is
27   Windows 7. Earlier versions, including Windows Vista and XP are no longer
28   supported.
29
30 * With this release, the autoconf build system is deprecated. It will be removed
31   in the 3.9 release. Please migrate to using CMake. For more information see:
32   `Building LLVM with CMake <CMake.html>`_
33
34 * We have documented our C API stability guarantees for both development and
35   release branches, as well as documented how to extend the C API. Please see
36   the `developer documentation <DeveloperPolicy.html#c-api-changes>`_ for more
37   information.
38
39 * The C API function LLVMLinkModules is deprecated. It will be removed in the
40   3.9 release. Please migrate to LLVMLinkModules2. Unlike the old function the
41   new one
42
43    * Doesn't take an unused parameter.
44    * Destroys the source instead of only damaging it.
45    * Does not record a message. Use the diagnostic handler instead.
46
47 * The C API functions LLVMParseBitcode, LLVMParseBitcodeInContext,
48   LLVMGetBitcodeModuleInContext and LLVMGetBitcodeModule have been deprecated.
49   They will be removed in 3.9. Please migrate to the versions with a 2 suffix.
50   Unlike the old ones the new ones do not record a diagnostic message. Use
51   the diagnostic handler instead.
52
53 * The deprecated C APIs LLVMGetBitcodeModuleProviderInContext and
54   LLVMGetBitcodeModuleProvider have been removed.
55
56 * The deprecated C APIs LLVMCreateExecutionEngine, LLVMCreateInterpreter,
57   LLVMCreateJITCompiler, LLVMAddModuleProvider and LLVMRemoveModuleProvider
58   have been removed.
59
60 * With this release, the C API headers have been reorganized to improve build
61   time. Type specific declarations have been moved to Type.h, and error
62   handling routines have been moved to ErrorHandling.h. Both are included in
63   Core.h so nothing should change for projects directly including the headers,
64   but transitive dependencies may be affected.
65
66 * llvm-ar now suports thin archives.
67
68 * llvm doesn't produce .data.rel.ro.local or .data.rel sections anymore.
69
70 * aliases to available_externally globals are now rejected by the verifier.
71
72 * the IR Linker has been split into IRMover that moves bits from one module to
73   another and Linker proper that decides what to link.
74
75 * Support for dematerializing has been dropped.
76
77 * RegisterScheduler::setDefault was removed. Targets that used to call into the
78   command line parser to set the DAGScheduler, and that don't have enough
79   control with setSchedulingPreference, should look into overriding the
80   SubTargetHook "getDAGScheduler()".
81
82 * ``ilist_iterator<T>`` no longer has implicit conversions to and from ``T*``,
83   since ``ilist_iterator<T>`` may be pointing at the sentinel (which is usually
84   not of type ``T`` at all).  To convert from an iterator ``I`` to a pointer,
85   use ``&*I``; to convert from a pointer ``P`` to an iterator, use
86   ``P->getIterator()``.  Alternatively, explicit conversions via
87   ``static_cast<T>(U)`` are still available.
88
89 * ``ilist_node<T>::getNextNode()`` and ``ilist_node<T>::getPrevNode()`` now
90   fail at compile time when the node cannot access its parent list.
91   Previously, when the sentinel was was an ``ilist_half_node<T>``, this API
92   could return the sentinal instead of ``nullptr``.  Frustrated callers should
93   be updated to use ``iplist<T>::getNextNode(T*)`` instead.  Alternatively, if
94   the node ``N`` is guaranteed not to be the last in the list, it is safe to
95   call ``&*++N->getIterator()`` directly.
96
97 * The `Kaleidoscope tutorials <tutorial/index.html>`_ have been updated to use
98   the ORC JIT APIs.
99
100 * ORC now has a basic set of C bindings.
101
102 * Optional support for linking clang and the LLVM tools with a single libLLVM
103   shared library. To enable this, pass ``-DLLVM_LINK_LLVM_DYLIB=ON`` to CMake.
104   See `Building LLVM with CMake`_ for more details.
105
106 * The optimization to move the prologue and epilogue of functions in colder
107   code path (shrink-wrapping) is now enabled by default.
108
109 * A new target-independent gcc-compatible emulated Thread Local Storage mode
110   is added.  When ``-femultated-tls`` flag is used, all accesses to TLS
111   variables are converted to calls to ``__emutls_get_address`` in the runtime
112   library.
113
114 * MSVC compatible exception handling has been completely overhauled. New
115   instructions have been introduced to facilitate this:
116   `New exception handling instructions <ExceptionHandling.html#new-exception-handling-instructions>`_. 
117   While we have done our best to test this feature thoroughly, it would
118   not be completely surprising if there were a few lingering issues that
119   early adopters might bump into.
120
121 .. NOTE
122    For small 1-3 sentence descriptions, just add an entry at the end of
123    this list. If your description won't fit comfortably in one bullet
124    point (e.g. maybe you would like to give an example of the
125    functionality, or simply have a lot to talk about), see the `NOTE` below
126    for adding a new subsection.
127
128 * ... next change ...
129
130 .. NOTE
131    If you would like to document a larger change, then you can add a
132    subsection about it right here. You can copy the following boilerplate
133    and un-indent it (the indentation causes it to be inside this comment).
134
135    Special New Feature
136    -------------------
137
138    Makes programs 10x faster by doing Special New Thing.
139
140
141 Changes to the ARM Backends
142 ---------------------------
143
144 During this release the AArch64 target has:
145
146 * Added support for more sanitizers (MSAN, TSAN) and made them compatible with
147   all VMA kernel configurations (currently tested on 39 and 42 bits).
148 * Gained initial LLD support in the new ELF back-end
149 * Extended the Load/Store optimiser and cleaned up some of the bad decisions
150   made earlier.
151 * Expanded LLDB support, including watchpoints, native building, Renderscript,
152   LLDB-server, debugging 32-bit applications.
153 * Added support for the ``Exynos M1`` chip.
154
155 During this release the ARM target has:
156
157 * Gained massive performance improvements on embedded benchmarks due to finally
158   running the stride vectorizer in full form, incrementing the performance gains
159   that we already had in the previous releases with limited stride vectorization.
160 * Expanded LLDB support, including watchpoints, unwind tables
161 * Extended the Load/Store optimiser and cleaned up some of the bad decisions
162   made earlier.
163 * Simplified code generation for global variable addresses in ELF, resulting in
164   a significant (4% in Chromium) reduction in code size.
165 * Gained some additional code size improvements, though there's still a long road
166   ahead, especially for older cores.
167 * Added some EABI floating point comparison functions to Compiler-RT
168 * Added support for Windows+GNU triple, +features in -mcpu/-march options.
169
170
171 Changes to the MIPS Target
172 --------------------------
173
174 During this release the MIPS target has:
175
176 * Significantly extended support for the Integrated Assembler. See below for
177   more information
178 * Added support for the ``P5600`` processor.
179 * Added support for the ``interrupt`` attribute for MIPS32R2 and later. This
180   attribute will generate a function which can be used as a interrupt handler
181   on bare metal MIPS targets using the static relocation model.
182 * Added support for the ``ERETNC`` instruction found in MIPS32R5 and later.
183 * Added support for OpenCL. See http://portablecl.org/.
184
185   * Address spaces 1 to 255 are now reserved for software use and conversions
186     between them are no-op casts.
187
188 * Removed the ``mips16`` value for the -mcpu option since it is an :abbr:`ASE
189   (Application Specific Extension)` and not a processor. If you were using this,
190   please specify another CPU and use ``-mips16`` to enable MIPS16.
191 * Removed ``copy_u.w`` from 32-bit MSA and ``copy_u.d`` from 64-bit MSA since
192   they have been removed from the MSA specification due to forward compatibility
193   issues.  For example, 32-bit MSA code containing ``copy_u.w`` would behave
194   differently on a 64-bit processor supporting MSA. The corresponding intrinsics
195   are still available and may expand to ``copy_s.[wd]`` where this is
196   appropriate for forward compatibility purposes.
197 * Relaxed the ``-mnan`` option to allow ``-mnan=2008`` on MIPS32R2/MIPS64R2 for
198   compatibility with GCC.
199 * Made MIPS64R6 the default CPU for 64-bit Android triples.
200
201 The MIPS target has also fixed various bugs including the following notable
202 fixes:
203
204 * Fixed reversed operands on ``mthi``/``mtlo`` in the DSP :abbr:`ASE
205   (Application Specific Extension)`.
206 * The code generator no longer uses ``jal`` for calls to absolute immediate
207   addresses.
208 * Disabled fast instruction selection on MIPS32R6 and MIPS64R6 since this is not
209   yet supported.
210 * Corrected addend for ``R_MIPS_HI16`` and ``R_MIPS_PCHI16`` in MCJIT
211 * The code generator no longer crashes when handling subregisters of an 64-bit
212   FPU register with undefined value.
213 * The code generator no longer attempts to use ``$zero`` for operands that do
214   not permit ``$zero``.
215 * Corrected the opcode used for ``ll``/``sc`` when using MIPS32R6/MIPS64R6 and
216   the Integrated Assembler.
217 * Added support for atomic load and atomic store.
218 * Corrected debug info when dynamically re-aligning the stack.
219
220 Integrated Assembler
221 ^^^^^^^^^^^^^^^^^^^^
222 We have made a large number of improvements to the integrated assembler for
223 MIPS. In this release, the integrated assembler isn't quite production-ready
224 since there are a few known issues related to bare-metal support, checking
225 immediates on instructions, and the N32/N64 ABI's. However, the current support
226 should be sufficient for many users of the O32 ABI, particularly those targeting
227 MIPS32 on Linux or bare-metal MIPS32.
228
229 If you would like to try the integrated assembler, please use
230 ``-fintegrated-as``.
231
232 Changes to the PowerPC Target
233 -----------------------------
234
235 There are numerous improvements to the PowerPC target in this release:
236
237 * Shrink wrapping optimization has been enabled for PowerPC Little Endian
238
239 * Direct move instructions are used when converting scalars to vectors
240
241 * Thread Sanitizer (TSAN) is now supported for PowerPC
242
243 * New MI peephole pass to clean up redundand XXPERMDI instructions  
244
245 * Add branch hints to highly biased branch instructions (code reaching
246   unreachable terminators and exceptional control flow consructs)
247
248 * Promote boolean return values to integer to prevent excessive usage of
249   condition registers
250
251 * Additional vector APIs for vector comparisons and vector merges have been
252   added to altivec.h
253
254 * Many bugs have been identified and fixed
255
256
257 Changes to the X86 Target
258 -----------------------------
259
260  During this release ...
261
262 * TLS is enabled for Cygwin as emutls.
263
264 * Smaller code for materializing 32-bit 1 and -1 constants at ``-Os``.
265
266 * More efficient code for wide integer compares. (E.g. 64-bit compares
267   on 32-bit targets.)
268
269 * Tail call support for ``thiscall``, ``stdcall``, ``vectorcall``, and
270   ``fastcall`` functions.
271
272 Changes to the Hexagon Target
273 -----------------------------
274
275 In addition to general code size and performance improvements, Hexagon target
276 now has basic support for Hexagon V60 architecture and Hexagon Vector
277 Extensions (HVX).
278
279 Changes to the AVR Target
280 -------------------------
281
282 Slightly less than half of the AVR backend has been merged in at this point. It is still
283 missing a number large parts which cause it to be unusable, but is well on the
284 road to being completely merged and workable.
285
286 Changes to the OCaml bindings
287 -----------------------------
288
289  During this release ...
290
291 * The ocaml function link_modules has been replaced with link_modules' which
292   uses LLVMLinkModules2.
293
294
295 External Open Source Projects Using LLVM 3.8
296 ============================================
297
298 An exciting aspect of LLVM is that it is used as an enabling technology for
299 a lot of other language and tools projects. This section lists some of the
300 projects that have already been updated to work with LLVM 3.8.
301
302 LDC - the LLVM-based D compiler
303 -------------------------------
304
305 `D <http://dlang.org>`_ is a language with C-like syntax and static typing. It
306 pragmatically combines efficiency, control, and modeling power, with safety and
307 programmer productivity. D supports powerful concepts like Compile-Time Function
308 Execution (CTFE) and Template Meta-Programming, provides an innovative approach
309 to concurrency and offers many classical paradigms.
310
311 `LDC <http://wiki.dlang.org/LDC>`_ uses the frontend from the reference compiler
312 combined with LLVM as backend to produce efficient native code. LDC targets
313 x86/x86_64 systems like Linux, OS X and Windows and also PowerPC (32/64 bit)
314 and ARM. Ports to other architectures like AArch64 and MIPS64 are underway.
315
316
317 Additional Information
318 ======================
319
320 A wide variety of additional information is available on the `LLVM web page
321 <http://llvm.org/>`_, in particular in the `documentation
322 <http://llvm.org/docs/>`_ section.  The web page also contains versions of the
323 API documentation which is up-to-date with the Subversion version of the source
324 code.  You can access versions of these documents specific to this release by
325 going into the ``llvm/docs/`` directory in the LLVM tree.
326
327 If you have any questions or comments about LLVM, please feel free to contact
328 us via the `mailing lists <http://llvm.org/docs/#maillist>`_.
329