1============================
2LLVM |release| Release Notes
3============================
4
5.. contents::
6    :local:
7
8
9Introduction
10============
11
12This document contains the release notes for the LLVM Compiler Infrastructure,
13release |release|.  Here we describe the status of LLVM, including major improvements
14from the previous release, improvements in various subprojects of LLVM, and
15some of the current users of the code.  All LLVM releases may be downloaded
16from the `LLVM releases web site <https://llvm.org/releases/>`_.
17
18For more information about LLVM, including information about the latest
19release, please check out the `main LLVM web site <https://llvm.org/>`_.  If you
20have questions or comments, the `LLVM Developer's Mailing List
21<https://lists.llvm.org/mailman/listinfo/llvm-dev>`_ is a good place to send
22them.
23
24Note that if you are reading this file from a Git checkout or the main
25LLVM web page, this document applies to the *next* release, not the current
26one.  To see the release notes for a specific release, please see the `releases
27page <https://llvm.org/releases/>`_.
28
29Non-comprehensive list of changes in this release
30=================================================
31.. NOTE
32   For small 1-3 sentence descriptions, just add an entry at the end of
33   this list. If your description won't fit comfortably in one bullet
34   point (e.g. maybe you would like to give an example of the
35   functionality, or simply have a lot to talk about), see the `NOTE` below
36   for adding a new subsection.
37
38* ...
39
40Update on required toolchains to build LLVM
41-------------------------------------------
42
43With LLVM 15.x we will raise the version requirements of the toolchain used
44to build LLVM. The new requirements are as follows:
45
46* GCC >= 7.1
47* Clang >= 5.0
48* Apple Clang >= 9.3
49* Visual Studio 2019 >= 16.7
50
51In LLVM 15.x these requirements will be "soft" requirements and the version
52check can be skipped by passing ``-DLLVM_TEMPORARILY_ALLOW_OLD_TOOLCHAIN=ON``
53to CMake.
54
55With the release of LLVM 16.x these requirements will be hard and LLVM developers
56can start using C++17 features, making it impossible to build with older
57versions of these toolchains.
58
59Changes to the LLVM IR
60----------------------
61
62* LLVM now uses `opaque pointers <OpaquePointers.html>`__. This means that
63  different pointer types like ``i8*``, ``i32*`` or ``void()**`` are now
64  represented as a single ``ptr`` type. See the linked document for migration
65  instructions.
66* Renamed ``llvm.experimental.vector.extract`` intrinsic to ``llvm.vector.extract``.
67* Renamed ``llvm.experimental.vector.insert`` intrinsic to ``llvm.vector.insert``.
68* The constant expression variants of the following instructions have been
69  removed:
70
71  * ``extractvalue``
72  * ``insertvalue``
73  * ``udiv``
74  * ``sdiv``
75  * ``urem``
76  * ``srem``
77  * ``fadd``
78  * ``fsub``
79  * ``fmul``
80  * ``fdiv``
81  * ``frem``
82
83* Added the support for ``fmax`` and ``fmin`` in ``atomicrmw`` instruction. The
84  comparison is expected to match the behavior of ``llvm.maxnum.*`` and
85  ``llvm.minnum.*`` respectively.
86* ``callbr`` instructions no longer use ``blockaddress`` arguments for labels.
87  Instead, label constraints starting with ``!`` refer directly to entries in
88  the ``callbr`` indirect destination list.
89
90.. code-block:: llvm
91
92    ; Old representation
93    %res = callbr i32 asm "", "=r,r,i"(i32 %x, i8 *blockaddress(@foo, %indirect))
94          to label %fallthrough [label %indirect]
95    ; New representation
96    %res = callbr i32 asm "", "=r,r,!i"(i32 %x)
97          to label %fallthrough [label %indirect]
98
99Changes to building LLVM
100------------------------
101
102* Omitting ``CMAKE_BUILD_TYPE`` when using a single configuration generator is now
103  an error. You now have to pass ``-DCMAKE_BUILD_TYPE=<type>`` in order to configure
104  LLVM. This is done to help new users of LLVM select the correct type: since building
105  LLVM in Debug mode is very resource intensive, we want to make sure that new users
106  make the choice that lines up with their usage. We have also improved documentation
107  around this setting that should help new users. You can find this documentation
108  `here <https://llvm.org/docs/CMake.html#cmake-build-type>`_.
109
110Changes to TableGen
111-------------------
112
113Changes to Loop Optimizations
114-----------------------------
115
116* Loop interchange legality and cost model improvements
117
118
119Changes to the AArch64 Backend
120------------------------------
121
122Changes to the AMDGPU Backend
123-----------------------------
124
125* 8 and 16-bit atomic loads and stores are now supported
126
127
128Changes to the ARM Backend
129--------------------------
130
131* Added support for the Armv9-A, Armv9.1-A and Armv9.2-A architectures.
132* Added support for the Armv8.1-M PACBTI-M extension.
133* Added support for the Armv9-A, Armv9.1-A and Armv9.2-A architectures.
134* Added support for the Armv8.1-M PACBTI-M extension.
135* Removed the deprecation of ARMv8-A T32 Complex IT blocks. No deprecation
136  warnings will be generated and -mrestrict-it is now always off by default.
137  Previously it was on by default for Armv8 and off for all other architecture
138  versions.
139* Added a pass to workaround Cortex-A57 Erratum 1742098 and Cortex-A72
140  Erratum 1655431. This is enabled by default when targeting either CPU.
141* Implemented generation of Windows SEH unwind information.
142* Switched the MinGW target to use SEH instead of DWARF for unwind information.
143* Added support for the Cortex-M85 CPU.
144* Added support for a new ``-mframe-chain=(none|aapcs|aapcs+leaf)`` command-line
145  option, which controls the generation of AAPCS-compliant Frame Records.
146
147Changes to the AVR Backend
148--------------------------
149
150* ...
151
152Changes to the DirectX Backend
153------------------------------
154
155* DirectX has been added as an experimental target. Specify
156  ``-DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD=DirectX`` in your CMake configuration
157  to enable it. The target is not packaged in pre-built binaries.
158* The DirectX backend supports the ``dxil`` architecture which is based on LLVM
159  3.6 IR encoded as bitcode and is the format used for DirectX GPU Shader
160  programs.
161
162Changes to the Hexagon Backend
163------------------------------
164
165* ...
166
167Changes to the MIPS Backend
168---------------------------
169
170* ...
171
172Changes to the PowerPC Backend
173------------------------------
174
175Common PowerPC improvements:
176* Add a new post instruction selection pass to generate CTR loops.
177* Add SSE4 and BMI compatible intrinsics implementation.
178* Supported 16-byte lock free atomics on PowerPC8 and up.
179* Supported atomic load/store for pointer types.
180* Supported stack size larger than 2G
181* Add __builtin_min/__builtin_max/__abs builtins.
182* Code generation improvements for splat load/vector shuffle/mulli, etc.
183* Emit VSX instructions for vector loads and stores regardless of alignment.
184* The mcpu=future has its own ISA now (FutureISA).
185* Added the ppc-set-dscr option to set the Data Stream Control Register (DSCR).
186* Bug fixes.
187
188AIX improvements:
189* Supported 64 bit XCOFF for integrated-as path.
190* Supported X86-compatible vector intrinsics.
191* Program code csect default alignment now is 32-byte.
192* Supported auxiliary header in integrated-as path.
193* Improved alias symbol handling.
194
195Changes to the RISC-V Backend
196-----------------------------
197
198* A RISCVRedundantCopyElimination pass was added to remove unnecessary zero
199  copies.
200* A RISC-V specific CodeGenPrepare pass was added.
201* The machine outliner was enabled by default for RISC-V at ``-Oz``.
202  Additionally, the newly introduced RISCVMakeCompressible pass will make
203  modify instructions prior to emission at ``-Oz`` in order to increase
204  opportunities for the compression with the RISC-V C extension.
205* Various bug fixes and improvements to code generation for the RISC-V vector
206  extensions.
207* Various improvements were made to RISC-V specific optimisation passes such
208  as RISCVSExtWRemoval and RISCVMergeBaseOffset.
209* llc now computes the target ABI based on the target architecture using the
210  same logic as Clang if not explicit ABI is given.
211* ``generic`` is now recognized as a valid CPU name and is mapped to
212  ``generic-rv32`` or ``generic-rv64`` depending on the target triple.
213* Support for the experimental Zvfh extension was added, enabling
214  half-precision floating point in vectors.
215* Support for the Zihintpause (Pause Hint) extension.
216* Assembler and disassembler support for the Zfinx and Zdinx (float / double
217  in integer register) extensions.
218* Assembler and disassembler support for the Zicbom, Zicboz, and Zicbop cache
219  management operation extensions.
220* Support for the Zmmul extension (a subextension of the M extension, adding
221  multiplication instructions only).
222* Assembler and disassembler support for the hypervisor extension and for the
223  Sinval supervisor memory-management extension.
224
225Changes to the WebAssembly Backend
226----------------------------------
227
228* ...
229
230Changes to the SystemZ Backend
231------------------------------
232
233* Support z16 processor name.
234* Machine scheduler description for z16.
235* Add support for inline assembly address operands ("p") as well as for SystemZ
236  specific address operands ("ZQ", "ZR", "ZS" and "ZT").
237* Efficient handling of small memcpy/memset operations up to 32 bytes.
238* Tuning of the inliner.
239* Fixing emission of library calls so that narrow integer arguments are sign or
240  zero extended per the SystemZ ABI.
241* Support added for libunwind.
242* Various minor improvements and bugfixes.
243
244Changes to the X86 Backend
245--------------------------
246
247* Support ``half`` type on SSE2 and above targets following X86 psABI.
248* Support ``rdpru`` instruction on Zen2 and above targets.
249
250During this release, ``half`` type has an ABI breaking change to provide the
251support for the ABI of ``_Float16`` type on SSE2 and above following X86 psABI.
252(`D107082 <https://reviews.llvm.org/D107082>`_)
253
254The change may affect the current use of ``half`` includes (but is not limited
255to):
256
257* Frontends generating ``half`` type in function passing and/or returning
258  arguments.
259* Downstream runtimes providing any ``half`` conversion builtins assuming the
260  old ABI.
261* Projects built with LLVM 15.0 but using early versions of compiler-rt.
262
263When you find failures with ``half`` type, check the calling conversion of the
264code and switch it to the new ABI.
265
266Changes to the OCaml bindings
267-----------------------------
268
269
270Changes to the C API
271--------------------
272
273* Add ``LLVMGetCastOpcode`` function to aid users of ``LLVMBuildCast`` in
274  resolving the best cast operation given a source value and destination type.
275  This function is a direct wrapper of ``CastInst::getCastOpcode``.
276
277* Add ``LLVMGetAggregateElement`` function as a wrapper for
278  ``Constant::getAggregateElement``, which can be used to fetch an element of a
279  constant struct, array or vector, independently of the underlying
280  representation. The ``LLVMGetElementAsConstant`` function is deprecated in
281  favor of the new function, which works on all constant aggregates, rather than
282  only instances of ``ConstantDataSequential``.
283
284* The following functions for creating constant expressions have been removed,
285  because the underlying constant expressions are no longer supported. Instead,
286  an instruction should be created using the ``LLVMBuildXYZ`` APIs, which will
287  constant fold the operands if possible and create an instruction otherwise:
288
289  * ``LLVMConstExtractValue``
290  * ``LLVMConstInsertValue``
291  * ``LLVMConstUDiv``
292  * ``LLVMConstExactUDiv``
293  * ``LLVMConstSDiv``
294  * ``LLVMConstExactSDiv``
295  * ``LLVMConstURem``
296  * ``LLVMConstSRem``
297  * ``LLVMConstFAdd``
298  * ``LLVMConstFSub``
299  * ``LLVMConstFMul``
300  * ``LLVMConstFDiv``
301  * ``LLVMConstFRem``
302
303* Add ``LLVMDeleteInstruction`` function which allows deleting instructions that
304  are not inserted into a basic block.
305
306* As part of the opaque pointer migration, the following APIs are deprecated and
307  will be removed in the next release:
308
309  * ``LLVMBuildLoad`` -> ``LLVMBuildLoad2``
310  * ``LLVMBuildCall`` -> ``LLVMBuildCall2``
311  * ``LLVMBuildInvoke`` -> ``LLVMBuildInvoke2``
312  * ``LLVMBuildGEP`` -> ``LLVMBuildGEP2``
313  * ``LLVMBuildInBoundsGEP`` -> ``LLVMBuildInBoundsGEP2``
314  * ``LLVMBuildStructGEP`` -> ``LLVMBuildStructGEP2``
315  * ``LLVMBuildPtrDiff`` -> ``LLVMBuildPtrDiff2``
316  * ``LLVMConstGEP`` -> ``LLVMConstGEP2``
317  * ``LLVMConstInBoundsGEP`` -> ``LLVMConstInBoundsGEP2``
318  * ``LLVMAddAlias`` -> ``LLVMAddAlias2``
319
320* Refactor compression namespaces across the project, making way for a possible
321  introduction of alternatives to zlib compression in the llvm toolchain.
322  Changes are as follows:
323
324  * Relocate the ``llvm::zlib`` namespace to ``llvm::compression::zlib``.
325  * Remove crc32 from zlib compression namespace, people should use the ``llvm::crc32`` instead.
326
327Changes to the Go bindings
328--------------------------
329
330
331Changes to the FastISel infrastructure
332--------------------------------------
333
334* ...
335
336Changes to the DAG infrastructure
337---------------------------------
338
339
340Changes to the Metadata Info
341---------------------------------
342
343* Add Module Flags Metadata ``stack-protector-guard-symbol`` which specify a
344  symbol for addressing the stack-protector guard.
345
346Changes to the Debug Info
347---------------------------------
348
349During this release ...
350
351Changes to the LLVM tools
352---------------------------------
353
354* (Experimental) :doc:`llvm-symbolizer <CommandGuide/llvm-symbolizer>` now has ``--filter-markup`` to
355  filter :doc:`Symbolizer Markup </SymbolizerMarkupFormat>` into human-readable
356  form.
357* :doc:`llvm-objcopy <CommandGuide/llvm-objcopy>` has removed support for the legacy ``zlib-gnu`` format.
358* :doc:`llvm-objcopy <CommandGuide/llvm-objcopy>` now allows ``--set-section-flags src=... --rename-section src=tst``.
359  ``--add-section=.foo1=... --rename-section=.foo1=.foo2`` now adds ``.foo1`` instead of ``.foo2``.
360* New features supported on AIX for ``llvm-ar``:
361
362  * AIX big-format archive write operation (`D123949 <https://reviews.llvm.org/D123949>`_)
363
364  * A new object mode option, ``-X`` , to specify the type of object file ``llvm-ar`` should operate upon (`D127864 <https://reviews.llvm.org/D127864>`_)
365
366  * Read global symbols of AIX big archive (`D124865 <https://reviews.llvm.org/D124865>`_)
367
368* New options supported for ``llvm-nm``:
369
370  * ``-X``, to specify the type of object file that ``llvm-nm`` should examine (`D118193 <https://reviews.llvm.org/D118193>`_)
371
372  * ``--export-symbols``, to create a list of symbols to export (`D112735 <https://reviews.llvm.org/D112735>`_)
373
374* The LLVM gold plugin now ignores bitcode from the ``.llvmbc`` section of ELF
375  files when doing LTO.  https://github.com/llvm/llvm-project/issues/47216
376* llvm-objcopy now supports 32 bit XCOFF.
377* llvm-objdump: improved assembly printing for XCOFF.
378* llc now parses code-model attribute from input file.
379
380Changes to LLDB
381---------------------------------
382
383* The "memory region" command now has a "--all" option to list all
384  memory regions (including unmapped ranges). This is the equivalent
385  of using address 0 then repeating the command until all regions
386  have been listed.
387* Added "--show-tags" option to the "memory find" command. This is off by default.
388  When enabled, if the target value is found in tagged memory, the tags for that
389  memory will be shown inline with the memory contents.
390* Various memory related parts of LLDB have been updated to handle
391  non-address bits (such as AArch64 pointer signatures):
392
393  * "memory read", "memory write" and "memory find" can now be used with
394    addresses with non-address bits.
395  * All the read and write memory methods on SBProccess and SBTarget can
396    be used with addreses with non-address bits.
397  * When printing a pointer expression, LLDB can now dereference the result
398    even if it has non-address bits.
399  * The memory cache now ignores non-address bits when looking up memory
400    locations. This prevents us reading locations multiple times, or not
401    writing out new values if the addresses have different non-address bits.
402
403* LLDB now supports reading memory tags from AArch64 Linux core files.
404
405* LLDB now supports the gnu debuglink section for reading debug information
406  from a separate file on Windows
407
408* LLDB now allows selecting the C++ ABI to use on Windows (between Itanium,
409  used for MingW, and MSVC) via the ``plugin.object-file.pe-coff.abi`` setting.
410  In Windows builds of LLDB, this defaults to the style used for LLVM's default
411  target.
412
413Changes to Sanitizers
414---------------------
415
416
417Other Changes
418-------------
419* The code for the `LLVM Visual Studio integration
420  <https://marketplace.visualstudio.com/items?itemName=LLVMExtensions.llvm-toolchain>`_
421  has been removed. This had been obsolete and abandoned since Visual Studio
422  started including an integration by default in 2019.
423
424* Added the unwinder, personality, and helper functions for exception handling
425  on AIX. (`D100132 <https://reviews.llvm.org/D100132>`_)
426  (`D100504 <https://reviews.llvm.org/D100504>`_)
427
428* PGO on AIX: A new implementation that requires linker support
429  (__start_SECTION/__stop_SECTION symbols) available on AIX 7.2 TL5 SP4 and
430  AIX 7.3 TL0 SP2.
431
432External Open Source Projects Using LLVM 15
433===========================================
434
435* A project...
436
437Additional Information
438======================
439
440A wide variety of additional information is available on the `LLVM web page
441<https://llvm.org/>`_, in particular in the `documentation
442<https://llvm.org/docs/>`_ section.  The web page also contains versions of the
443API documentation which is up-to-date with the Git version of the source
444code.  You can access versions of these documents specific to this release by
445going into the ``llvm/docs/`` directory in the LLVM tree.
446
447If you have any questions or comments about LLVM, please feel free to contact
448us via the `mailing lists <https://llvm.org/docs/#mailing-lists>`_.
449