Release of the LLVM 16.0 compiler suite

After six months of development, the release of the LLVM 16.0 project is presented - a GCC-compatible toolkit (compilers, optimizers and code generators) that compiles programs into an intermediate bitcode of RISC-like virtual instructions (a low-level virtual machine with a multi-level optimization system). The generated pseudo-code can be converted by the JIT compiler into machine instructions right at the time of program execution.

Major improvements in Clang 16.0:

  • The default C++/ObjC++ standard is set to gnu++17 (formerly gnu++14), which implies support for C++17 features with GNU extensions by default. You can use the "-std=gnu++14" option to revert back to the previous behavior.
  • Implemented advanced features related to the C++20 standard:
    • Conditionally trivial special member functions,
    • capturing structured bindings in lambda functions,
    • Equality operator inside expressions,
    • Ability to not specify the typename keyword in some contexts,
    • Permissibility of aggregate initialization in brackets ("Aggr(val1, val2)").
  • Implemented features defined in the future C++2b standard:
    • Labels are allowed at the end of compound expressions,
    • static operator(),
    • static operator[],
    • Provided compatibility with char8_t type,
    • The range of characters allowed for use in "\N{...}" has been expanded,
    • Added the ability to use variables declared as "static constexpr" in functions declared as constexpr.
  • Implemented features defined in the future C2x C standard:
    • To disable the "-Wunused-label" warning, the "[[maybe_unused]]" attribute can be applied to labels
    • Labels can be placed anywhere inside compound expressions,
    • Added typeof and typeof_unqual operators,
    • A new nullptr_t type and a nullptr constant to define null pointers that can be converted to any pointer type and represent a variant of NULL that is not bound to integral types and void*.
    • In C2x mode, calling the va_start macro with a variable number of arguments (variadic) is allowed.
  • In C99, C11, and C17 conformance modes, the "-Wimplicit-function-declaration" and "-Wimplicit-int" options now produce an error instead of a warning by default.
  • Indirect use of "void *" (for example, "void func(void *p) { *p; }") in C++ mode now generates an error, similar to ISO C++, GCC, ICC, and MSVC.
  • Specifying bitfields as instruction operands (e.g. "__asm ​​{ mov eax, s.bf }") in Microsoft-style inline assembly blocks now generates an error.
  • Added diagnostics for the presence of different structures and unions with the same names in different modules.
  • Expanded capabilities related to support for OpenCL and OpenMP. Improved diagnostics of C++ templates used in OpenCL kernel arguments. Improved queuing block support for AMDGPU. The nounwind attribute is implicitly added to all functions. Improved support for built-in functions.
  • Added the ability to use the CLANG_CRASH_DIAGNOSTICS_DIR environment variable to define the directory in which crash diagnostic data is saved.
  • Unicode support has been updated to the Unicode 15.0 specification. Some mathematical symbols are allowed in identifiers, such as "β‚Š" (e.g. "double xβ‚–β‚Šβ‚").
  • Added support for loading multiple configuration files (default configuration files are loaded first, and then those specified via the β€œ--config=” flag, which can now be specified multiple times). Changed the default loading order of configuration files: clang tries to load the file first - .cfg, and if it is not found it tries to load two files .cfg and .cfg. To disable loading configuration files by default, the β€œ--no-default-config” flag has been added.
  • To ensure repeatable builds, it is possible to replace the current date and time values ​​in the __DATE__, __TIME__ and __TIMESTAMP__ macros with the time specified in the SOURCE_DATE_EPOCH environment variable.
  • To check for built-in functions (builtin) that can be used in the context of constants, the "__has_constexpr_builtin" macro has been added.
  • Added new compile flag "-fcoro-aligned-allocation" for aligned distribution of coroutine frames.
  • The "-fstrict-flex-arrays=" flag implements support for the third level of checking a flexible array element in structures (Flexible Array Members, an array of indefinite size at the end of the structure). At the third level, only the size "[]" (for example, "int b[]") is treated as a flexible array, but the size "[0]" (for example, "int b[0]") is not.
  • Added "-fmodule-output" flag to enable single-phase compilation model for standard C++ modules.
  • Added "-Rpass-analysis=stack-frame-layout" mode, which allows diagnosing problems with stack frame layout.
  • A new attribute __attribute__((target_version("cpu_features"))) has been added and the functionality of the attribute __attribute__((target_clones("cpu_features1β€³,"cpu_features2",…))) has been extended to select specific versions of features provided by CPU AArch64.
  • Enhanced diagnostic tools:
    • Added "-Wsingle-bit-bitfield-constant-conversion" warning to detect implicit truncation when assigning one to a one-bit signed bitfield.
    • Extended diagnostics of uninitialized constexpr variables.
    • Added "-Wcast-function-type-strict" and "-Wincompatible-function-pointer-types-strict" warnings to detect potential issues with function type casting.
    • Added diagnostics for using incorrect or reserved module names in export blocks.
    • Improved detection of missing "auto" keywords in definitions.
    • Added checks for additional overflow situations to the "-Winteger-overflow" warning implementation.
  • Implemented support for the LoongArch instruction set architecture (-march=loongarch64 or -march=la464) used in the Loongson 3 5000 processors, which implements a new RISC ISA similar to MIPS and RISC-V.

Key innovations in LLVM 16.0:

  • In LLVM code, the use of elements defined in the C++17 standard is allowed.
  • Increased environment requirements for building LLVM. The build toolkit should now support the C++17 standard, i.e. build requires at least GCC 7.1, Clang 5.0, Apple Clang 10.0, or Visual Studio 2019 16.7.
  • Support for Cortex-A64, Cortex-X715 and Neoverse V3 CPUs, RME MEC (Memory Encryption Contexts) assembler, Armv2 extensions (Complex Number) and Function Multi Versioning has been added to the AArch8.3 backend.
  • The ARM architecture backend no longer supports the target platforms Armv2, Armv2A, Armv3 and Armv3M, for which correct code generation was not guaranteed. Added the ability to generate code for instructions for working with complex numbers.
  • Added support for instruction set architectures (ISA) AMX-FP86, CMPCXADD, AVX-IFMA, AVX-VNNI-INT16, AVX-NE-CONVERT to the X8 backend. Added support for RDMSRLIST, RMSRLIST and WRMSRNS instructions. Implemented "-mcpu=raptorlake", "-mcpu=meteorlake", "-mcpu=emeraldrapids", "-mcpu=sierraforest", "-mcpu=graniterapids", and "-mcpu=grandridge" options.
  • Added official support for the LoongArch platform.
  • Improved backends for MIPS, PowerPC and RISC-V architectures
  • Support for debugging 64-bit executables for the LoongArch architecture has been added to the LLDB debugger. Improved handling of COFF debug symbols. Filtering of duplicate DLLs in the list of loaded Windows modules has been provided.
  • In the Libc++ library, the main work was focused on implementing support for new features of the C++20 and C++23 standards.
  • Linking time has been significantly reduced in the LDD linker by parallelizing address relocation scanning and section initialization operations. Added support for section compression using the ZSTD algorithm.

Source: opennet.ru

Add a comment