1======================== 2LLVM 7.0.0 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 7.0.0. 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 24Non-comprehensive list of changes in this release 25================================================= 26 27* The Windows installer no longer includes a Visual Studio integration. 28 Instead, a new 29 `LLVM Compiler Toolchain Visual Studio extension <https://marketplace.visualstudio.com/items?itemName=LLVMExtensions.llvm-toolchain>`_ 30 is available on the Visual Studio Marketplace. The new integration 31 supports Visual Studio 2017. 32 33* Libraries have been renamed from 7.0 to 7. This change also impacts 34 downstream libraries like lldb. 35 36* The LoopInstSimplify pass (``-loop-instsimplify``) has been removed. 37 38* Symbols starting with ``?`` are no longer mangled by LLVM when using the 39 Windows ``x`` or ``w`` IR mangling schemes. 40 41* A new tool named :doc:`llvm-exegesis <CommandGuide/llvm-exegesis>` has been 42 added. :program:`llvm-exegesis` automatically measures instruction scheduling 43 properties (latency/uops) and provides a principled way to edit scheduling 44 models. 45 46* A new tool named :doc:`llvm-mca <CommandGuide/llvm-mca>` has been added. 47 :program:`llvm-mca` is a static performance analysis tool that uses 48 information available in LLVM to statically predict the performance of 49 machine code for a specific CPU. 50 51* Optimization of floating-point casts is improved. This may cause surprising 52 results for code that is relying on the undefined behavior of overflowing 53 casts. The optimization can be disabled by specifying a function attribute: 54 ``"strict-float-cast-overflow"="false"``. This attribute may be created by the 55 clang option ``-fno-strict-float-cast-overflow``. 56 Code sanitizers can be used to detect affected patterns. The clang option for 57 detecting this problem alone is ``-fsanitize=float-cast-overflow``: 58 59.. code-block:: c 60 61 int main() { 62 float x = 4294967296.0f; 63 x = (float)((int)x); 64 printf("junk in the ftrunc: %f\n", x); 65 return 0; 66 } 67 68.. code-block:: bash 69 70 clang -O1 ftrunc.c -fsanitize=float-cast-overflow ; ./a.out 71 ftrunc.c:5:15: runtime error: 4.29497e+09 is outside the range of representable values of type 'int' 72 junk in the ftrunc: 0.000000 73 74* ``LLVM_ON_WIN32`` is no longer set by ``llvm/Config/config.h`` and 75 ``llvm/Config/llvm-config.h``. If you used this macro, use the compiler-set 76 ``_WIN32`` instead which is set exactly when ``LLVM_ON_WIN32`` used to be set. 77 78* The ``DEBUG`` macro has been renamed to ``LLVM_DEBUG``, the interface remains 79 the same. If you used this macro you need to migrate to the new one. 80 You should also clang-format your code to make it easier to integrate future 81 changes locally. This can be done with the following bash commands: 82 83.. code-block:: bash 84 85 git grep -l 'DEBUG' | xargs perl -pi -e 's/\bDEBUG\s?\(/LLVM_DEBUG(/g' 86 git diff -U0 master | ../clang/tools/clang-format/clang-format-diff.py -i -p1 -style LLVM 87 88* Early support for UBsan, X-Ray instrumentation and libFuzzer (x86 and x86_64) 89 for OpenBSD. Support for MSan (x86_64), X-Ray instrumentation and libFuzzer 90 (x86 and x86_64) for FreeBSD. 91 92* ``SmallVector<T, 0>`` shrank from ``sizeof(void*) * 4 + sizeof(T)`` to 93 ``sizeof(void*) + sizeof(unsigned) * 2``, smaller than ``std::vector<T>`` on 94 64-bit platforms. The maximum capacity is now restricted to ``UINT32_MAX``. 95 Since SmallVector doesn't have the exception-safety pessimizations some 96 implementations saddle ``std::vector`` with and is better at using ``realloc``, 97 it's now a better choice even on the heap (although when ``TinyPtrVector`` works, 98 that's even smaller). 99 100* Preliminary/experimental support for DWARF v5 debugging information, 101 including the new ``.debug_names`` accelerator table. DWARF emitted at ``-O0`` 102 should be fully DWARF v5 compliant. Type units and split DWARF are known 103 not to be compliant, and higher optimization levels will still emit some 104 information in v4 format. 105 106* Added support for the ``.rva`` assembler directive for COFF targets. 107 108* The :program:`llvm-rc` tool (Windows Resource Compiler) has been improved 109 a bit. There are still known missing features, but it is generally usable 110 in many cases. (The tool still doesn't preprocess input files automatically, 111 but it can now handle leftover C declarations in preprocessor output, if 112 given output from a preprocessor run externally.) 113 114* CodeView debug info can now be emitted for MinGW configurations, if requested. 115 116* The :program:`opt` tool now supports the ``-load-pass-plugin`` option for 117 loading pass plugins for the new PassManager. 118 119* Support for profiling JITed code with perf. 120 121 122Changes to the LLVM IR 123---------------------- 124 125* The signatures for the builtins ``@llvm.memcpy``, ``@llvm.memmove``, and 126 ``@llvm.memset`` have changed. Alignment is no longer an argument, and are 127 instead conveyed as parameter attributes. 128 129* ``invariant.group.barrier`` has been renamed to ``launder.invariant.group``. 130 131* ``invariant.group`` metadata can now refer only to empty metadata nodes. 132 133Changes to the AArch64 Target 134----------------------------- 135 136* The ``.inst`` assembler directive is now usable on both COFF and Mach-O 137 targets, in addition to ELF. 138 139* Support for most remaining COFF relocations has been added. 140 141* Support for TLS on Windows has been added. 142 143* Assembler and disassembler support for the ARM Scalable Vector Extension has 144 been added. 145 146Changes to the ARM Target 147------------------------- 148 149* The ``.inst`` assembler directive is now usable on both COFF and Mach-O 150 targets, in addition to ELF. For Thumb, it can now also automatically 151 deduce the instruction size, without having to specify it with 152 e.g. ``.inst.w`` as before. 153 154Changes to the Hexagon Target 155----------------------------- 156 157* Hexagon now supports auto-vectorization for HVX. It is disabled by default 158 and can be turned on with ``-fvectorize``. For auto-vectorization to take 159 effect, code generation for HVX needs to be enabled with ``-mhvx``. 160 The complete set of options should include ``-fvectorize``, ``-mhvx``, 161 and ``-mhvx-length={64b|128b}``. 162 163* The support for Hexagon ISA V4 is deprecated and will be removed in the 164 next release. 165 166Changes to the MIPS Target 167-------------------------- 168 169During this release the MIPS target has: 170 171* Added support for Virtualization, Global INValidate ASE, 172 and CRC ASE instructions. 173 174* Introduced definitions of ``[d]rem``, ``[d]remu``, 175 and microMIPSR6 ``ll/sc`` instructions. 176 177* Shrink-wrapping is now supported and enabled by default (except for ``-O0``). 178 179* Extended size reduction pass by the LWP and SWP instructions. 180 181* Gained initial support of GlobalISel instruction selection framework. 182 183* Updated the P5600 scheduler model not to use instruction itineraries. 184 185* Added disassembly support for comparison and fused (negative) multiply 186 ``add/sub`` instructions. 187 188* Improved the selection of multiple instructions. 189 190* Load/store ``lb``, ``sb``, ``ld``, ``sd``, ``lld``, ... instructions 191 now support 32/64-bit offsets. 192 193* Added support for ``y``, ``M``, and ``L`` inline assembler operand codes. 194 195* Extended list of relocations supported by the ``.reloc`` directive 196 197* Fixed using a wrong register class for creating an emergency 198 spill slot for mips3 / n64 ABI. 199 200* MIPS relocation types were generated for microMIPS code. 201 202* Corrected definitions of multiple instructions (``lwp``, ``swp``, ``ctc2``, 203 ``cfc2``, ``sync``, ``synci``, ``cvt.d.w``, ...). 204 205* Fixed atomic operations at ``-O0`` level. 206 207* Fixed local dynamic TLS with Sym64 208 209Changes to the PowerPC Target 210----------------------------- 211 212During this release the PowerPC target has: 213 214* Replaced the list scheduler for post register allocation with the machine scheduler. 215 216* Added support for ``coldcc`` calling convention. 217 218* Added support for ``symbol@high`` and ``symbol@higha`` symbol modifiers. 219 220* Added support for quad-precision floating point type (``__float128``) under the llvm option ``-enable-ppc-quad-precision``. 221 222* Added dump function to ``LatencyPriorityQueue``. 223 224* Completed the Power9 scheduler model. 225 226* Optimized TLS code generation. 227 228* Improved MachineLICM for hoisting constant stores. 229 230* Improved code generation to reduce register use by using more register + immediate instructions. 231 232* Improved code generation to better exploit rotate-and-mask instructions. 233 234* Fixed the bug in dynamic loader for JIT which crashed NNVM. 235 236* Numerous bug fixes and code cleanups. 237 238Changes to the SystemZ Target 239----------------------------- 240 241During this release the SystemZ target has: 242 243* Added support for vector registers in inline asm statements. 244 245* Added support for stackmaps, patchpoints, and the anyregcc 246 calling convention. 247 248* Changed the default function alignment to 16 bytes. 249 250* Improved codegen for condition code handling. 251 252* Improved instruction scheduling and microarchitecture tuning for z13/z14. 253 254* Fixed support for generating GCOV coverage data. 255 256* Fixed some codegen bugs. 257 258Changes to the X86 Target 259------------------------- 260 261* The calling convention for the ``f80`` data type on MinGW targets has been 262 fixed. Normally, the calling convention for this type is handled within clang, 263 but if an intrinsic is used, which LLVM expands into a libcall, the 264 proper calling convention needs to be supported in LLVM as well. (Note, 265 on Windows, this data type is only used for long doubles in MinGW 266 environments - in MSVC environments, long doubles are the same size as 267 normal doubles.) 268 269Changes to the OCaml bindings 270----------------------------- 271 272* Removed ``add_bb_vectorize``. 273 274 275Changes to the C API 276-------------------- 277 278* Removed ``LLVMAddBBVectorizePass``. The implementation was removed and the C 279 interface was made a deprecated no-op in LLVM 5. Use 280 ``LLVMAddSLPVectorizePass`` instead to get the supported SLP vectorizer. 281 282* Expanded the OrcJIT APIs so they can register event listeners like debuggers 283 and profilers. 284 285Changes to the DAG infrastructure 286--------------------------------- 287* ``ADDC``/``ADDE``/``SUBC``/``SUBE`` are now deprecated and will default to expand. Backends 288 that wish to continue to use these opcodes should explicitely request to do so 289 using ``setOperationAction`` in their ``TargetLowering``. New backends 290 should use ``UADDO``/``ADDCARRY``/``USUBO``/``SUBCARRY`` instead of the deprecated opcodes. 291 292* The ``SETCCE`` opcode has now been removed in favor of ``SETCCCARRY``. 293 294* TableGen now supports multi-alternative pattern fragments via the ``PatFrags`` 295 class. ``PatFrag`` is now derived from ``PatFrags``, which may require minor 296 changes to backends that directly access ``PatFrag`` members. 297 298 299External Open Source Projects Using LLVM 7 300========================================== 301 302Zig Programming Language 303------------------------ 304 305`Zig <https://ziglang.org>`_ is an open-source programming language designed 306for robustness, optimality, and clarity. Zig is an alternative to C, providing 307high level features such as generics, compile time function execution, partial 308evaluation, and LLVM-based coroutines, while exposing low level LLVM IR 309features such as aliases and intrinsics. Zig uses Clang to provide automatic 310import of .h symbols - even inline functions and macros. Zig uses LLD combined 311with lazily building compiler-rt to provide out-of-the-box cross-compiling for 312all supported targets. 313 314 315Additional Information 316====================== 317 318A wide variety of additional information is available on the `LLVM web page 319<https://llvm.org/>`_, in particular in the `documentation 320<https://llvm.org/docs/>`_ section. The web page also contains versions of the 321API documentation which is up-to-date with the Subversion version of the source 322code. You can access versions of these documents specific to this release by 323going into the ``llvm/docs/`` directory in the LLVM tree. 324 325If you have any questions or comments about LLVM, please feel free to contact 326us via the `mailing lists <https://llvm.org/docs/#mailing-lists>`_. 327