Release of the LLVM 13.0 compiler suite

After six months of development, the release of the LLVM 13.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.

Improvements in Clang 13.0:

  • Implemented support for guaranteed tail calls (calling a subroutine at the very end of a function, forming a tail recursion if the subroutine is called itself). Support for guaranteed tail calls is provided by the "[[clang::musttail]]" attribute in C++ and "__attribute__((musttail))" in C, used in the "return" statement. The feature allows you to implement optimizations through the deployment of code in a flat iteration to save stack consumption.
  • Using declarations and clang extensions support C++11-style attribute definitions using the "[[]]" format.
  • Added "-Wreserved-identifier" flag to display a warning when specifying reserved identifiers in custom code.
  • Added "-Wunused-but-set-parameter" and "-Wunused-but-set-variable" flags to warn if a parameter or variable is set but not used.
  • Added "-Wnull-pointer-subtraction" flag to issue a warning if the code could lead to undefined behavior due to the use of a null pointer in subtraction operations.
  • Added "-fstack-usage" flag to generate for each code file an additional ".su" file containing information about the stack frame size for each function defined in the processed file.
  • A new output type has been added to the static analyzer - "sarif-html", which leads to the generation of reports simultaneously in HTML and Sarif formats. Added new check allocClassWithName. When specifying the "-analyzer-display-progress" option, the analysis time of each function is displayed. The smart pointer analyzer (alpha.cplusplus.SmartPtr) is almost ready.
  • Expanded features related to OpenCL support. Added support for new extensions cl_khr_integer_dot_product, cl_khr_extended_bit_ops, __cl_clang_bitfields and __cl_clang_non_portable_kernel_param_types. Continued implementation of the OpenCL 3.0 specification. For C, the OpenCL 1.2 specification is used by default unless a different version is explicitly selected. For C++, support for files with the ".clcpp" extension has been added.
  • Implemented support for loop transformation directives ("#pragma omp unrol" and "#pragma omp tile") defined in the OpenMP 5.1 specification.
  • Options added to the clang-format utility: SpacesInLineCommentPrefix to define the number of spaces before comments, IndentAccessModifiers, LambdaBodyIndentation and PPIndentWidth to control the alignment of records, lambda expressions and preprocessor directives. Sorting options for enumerating header files (SortIncludes) have been expanded. Added support for formatting JSON files.
  • A large portion of new checks has been added to linter clang-tidy.

Key innovations in LLVM 13.0:

  • The "-ehcontguard" option has been added to use CET (Windows Control-flow Enforcement Technology) technology to protect the exception handling phase from executing exploits built using Return-Oriented Programming (ROP) techniques.
  • The debuginfo-test project has been renamed to cross-project-tests and is designed to test components from different projects, not limited to debug information.
  • The build system provides support for building several distributions, for example, one with utilities, and the second with libraries for developers.
  • The backend for the AArch64 architecture in assembler supports the Armv9-A RME (Realm Management Extension) and SME (Scalable Matrix Extension) extensions.
  • Support for ISA V68/HVX has been added to the Hexagon backend.
  • Improved support for AMD Zen 86 processors in the x3 backend.
  • Support for GFX1013 RDNA2 APUs has been added to the AMDGPU backend.
  • Libc++ continues to implement new features of the C++20 and C++2b standards, including the completed implementation of the "concepts" library. Support for std::filesystem has been added for the MinGW-based Windows platform. Separated header files , And . Added build option LIBCXX_ENABLE_INCOMPLETE_FEATURES to disable header files with incomplete functionality.
  • The capabilities of the LLD linker have been extended to support Big-endian Aarch64 processors, and the Mach-O backend has been brought to a state that allows linking ordinary programs. Enhancements required for linking Glibc using LLD are included.
  • The llvm-mca (Machine Code Analyzer) utility has added support for processors that execute instructions in order (in-order superscalar pipeline), such as ARM Cortex-A55.
  • The LLDB debugger for the AArch64 platform has full support for Pointer Authentication, MTE mechanism (MemTag, Memory Tagging Extension), and SVE registers. Commands have been added that allow you to bind tags to each memory allocation operation and organize a check of the pointer when accessing the memory, which must be associated with the correct tag.
  • The LLDB debugger and the frontend for the Fortran language - Flang have been added to the binary assemblies generated by the project.

Source: opennet.ru

Add a comment