<!-- This document is written in Markdown and uses extra directives provided by
MyST (https://myst-parser.readthedocs.io/en/latest/). -->

<!-- If you want to modify sections/contents permanently, you should modify both
ReleaseNotes.md and ReleaseNotesTemplate.txt. -->

# LLVM {{env.config.release}} Release Notes


::::{only} PreRelease
:::{warning} These are in-progress notes for the upcoming LLVM {{env.config.release}}
             release. Release notes for previous releases can be found on
             [the Download Page](https://releases.llvm.org/download.html).
:::
::::

## Introduction

This document contains the release notes for the LLVM Compiler Infrastructure,
release {{env.config.release}}.  Here we describe the status of LLVM, including
major improvements from the previous release, improvements in various subprojects
of LLVM, and some of the current users of the code.  All LLVM releases may be
downloaded from the [LLVM releases web site](https://llvm.org/releases/).

For more information about LLVM, including information about the latest
release, please check out the [main LLVM web site](https://llvm.org/).  If you
have questions or comments, the [Discourse forums](https://discourse.llvm.org)
is a good place to ask them.

Note that if you are reading this file from a Git checkout or the main
LLVM web page, this document applies to the *next* release, not the current
one.  To see the release notes for a specific release, please see the
[releases page](https://llvm.org/releases/).

## Non-comprehensive list of changes in this release

<!-- For small 1-3 sentence descriptions, just add an entry at the end of
this list. If your description won't fit comfortably in one bullet
point (e.g. maybe you would like to give an example of the
functionality, or simply have a lot to talk about), see the comment below
for adding a new subsection. -->

* ...

<!-- If you would like to document a larger change, then you can add a
subsection about it right here. You can copy the following boilerplate:

### Special New Feature

Makes programs 10x faster by doing Special New Thing.
-->

### Changes to the LLVM IR

* LLVM now assigns persistent print IDs to metadata nodes. Reusing these IDs
  avoids repeated module-wide scans to rebuild metadata numbering, which can
  significantly speed up debug and pass printing on large modules. Keeping
  the IDs stable also makes repeated output easier to compare: unchanged
  metadata keeps the same number as passes modify the module. The numbering
  and definition order can differ from earlier releases, so tests of
  intermediate output may need updated expectations.

  LLVM's standard final-output paths renumber metadata in canonical order.
  This gives consecutive IDs with no gaps and makes the final IR easier to
  read. C++ clients that call `Module::print()` directly do not renumber
  automatically. For final IR output, these clients should call
  `Module::renumberMetadataForAssembly()` immediately before printing. Keep
  persistent IDs for intermediate dumps so their numbering remains stable.

  Standalone metadata printing now uses numbered definitions such as
  `!1 = !DIFile(...)` instead of pointer-based forms such as
  `<0x...> = !DIFile(...)`. Tools and tests that compare such output may need
  updating.

* Added `llvm.vector.reduce.fmaximumnum` and `llvm.vector.reduce.fminimumnum`
  intrinsics, the reduction variants of `llvm.maximumnum` and
  `llvm.minimumnum`.
* Added `llvm.smulh` and `llvm.umulh` intrinsics for signed and unsigned
  multiply returning the high-order half of the 2N-bit product of iN operands.
* Added `nofreeobj` attribute for attributes and returns, which forbids
  freeing the underlying object (as opposed to only frees through that specific
  pointer). Renamed `!nofree` metadata to `!nofreeobj`, as it has the same
  semantics.
* The following VP intrinsics have been removed:
  * `llvm.vp.select.*`
  * `llvm.vp.add.*`
  * `llvm.vp.sub.*`
  * `llvm.vp.mul.*`
  * `llvm.vp.ashr.*`
  * `llvm.vp.lshr.*`
  * `llvm.vp.shl.*`
  * `llvm.vp.or.*`
  * `llvm.vp.and.*`
  * `llvm.vp.xor.*`
  * `llvm.vp.abs.*`
  * `llvm.vp.smax.*`
  * `llvm.vp.smin.*`
  * `llvm.vp.umax.*`
  * `llvm.vp.umin.*`
  * `llvm.vp.copysign.*`
  * `llvm.vp.minnum.*`
  * `llvm.vp.maxnum.*`
  * `llvm.vp.minimum.*`
  * `llvm.vp.maximum.*`
  * `llvm.vp.fadd.*`
  * `llvm.vp.fsub.*`
  * `llvm.vp.fmul.*`
  * `llvm.vp.fdiv.*`
  * `llvm.vp.frem.*`
  * `llvm.vp.fneg.*`
  * `llvm.vp.fabs.*`
  * `llvm.vp.sqrt.*`
  * `llvm.vp.fma.*`
  * `llvm.vp.fmuladd.*`
  * `llvm.vp.trunc.*`
  * `llvm.vp.zext.*`
  * `llvm.vp.sext.*`
  * `llvm.vp.fptrunc.*`
  * `llvm.vp.fpext.*`
  * `llvm.vp.fptoui.*`
  * `llvm.vp.fptosi.*`
  * `llvm.vp.uitofp.*`
  * `llvm.vp.sitofp.*`
  * `llvm.vp.ptrtoint.*`
  * `llvm.vp.inttoptr.*`
  * `llvm.vp.fcmp.*`
  * `llvm.vp.icmp.*`
  * `llvm.vp.ceil.*`
  * `llvm.vp.floor.*`
  * `llvm.vp.rint.*`
  * `llvm.vp.nearbyint.*`
  * `llvm.vp.round.*`
  * `llvm.vp.roundeven.*`
  * `llvm.vp.roundtozero.*`
  * `llvm.vp.lrint.*`
  * `llvm.vp.llrint.*`
  * `llvm.vp.bitreverse.*`
  * `llvm.vp.bswap.*`
  * `llvm.vp.ctpop.*`
  * `llvm.vp.ctlz.*`
  * `llvm.vp.cttz.*`
  * `llvm.vp.sadd.sat.*`
  * `llvm.vp.uadd.sat.*`
  * `llvm.vp.ssub.sat.*`
  * `llvm.vp.usub.sat.*`
  * `llvm.vp.fshl.*`
  * `llvm.vp.fshr.*`
  * `llvm.vp.is.fpclass.*`

  These intrinsics previously only set masked-off lanes to poison, and will be
  automatically upgraded to their non-VP equivalent.  On RISC-V the VL optimizer
  should automatically infer `vl` in most cases from a store or reduction
  instruction, so passing around an explicit EVL operand shouldn't be required.
  If needed a "root" EVL can be synthesized with `llvm.vp.merge`, e.g:

  ```llvm
  %x = add <vscale x 2 x i32> %y, %z
  %res = call <vscale x 2 x i32> @llvm.vp.merge(<vscale x 2 x i32> %x, <vscale x 2 x i32> poison, <vscale x 2 x i1> splat (i1 true), i32 %evl)
  ```

  The `llvm.vp.merge` will be folded away but the `%evl` will be propagated to
  the add instruction.

* The `llvm.strip.invariant.group` intrinsic has been removed. It existed to
  work around a bug relating to replacement of pointers with different
  provenance based on dominating equality conditions, and is no longer needed.

* Introduced the generic `!atomic.ignore.denormal.mode` metadata for
  floating-point `atomicrmw` instructions, generalizing the previously
  AMDGPU-specific `!amdgpu.ignore.denormal.mode`.

* Added the `bitinsert` and `bitextract` instructions for bit-range
  manipulation on byte type values.

### Changes to LLVM infrastructure

* Removed `TargetOptions::FloatABIType`. The soft float ABI should be
  controlled by setting the `"float-abi"` module flag.

* Removed `TargetOptions::EABIVersion` and the `llc`/`opt` `-meabi` flag. The
  GNU-vs-EABI distinction is now derived entirely from the target triple's
  environment (e.g. `arm-none-gnueabi` vs `arm-none-eabi`).

* Replaced `TargetOptions::EnableMachineFunctionSplitter` with
  `TargetOptions::FunctionSplitting`, and the `-split-machine-functions` and
  `-enable-split-machine-functions` flags with
  `-function-splitting={none,bbsections,all}`.
  * Backend tools (`llc`, `opt`, LTO plugin options and libLTO debug options):
    use `-function-splitting=all` for the previous behavior.
  * Clang and Flang: `-fsplit-machine-functions` is unchanged and remains the
    recommended spelling. `-mllvm -enable-split-machine-functions` should be
    replaced with `-fsplit-machine-functions` or
    `-mllvm -function-splitting=all`.

* Merged the `MachineFunctionSplitter` pass into the `BasicBlockSections`
  pass, which now performs all function splitting: it uses the basic block
  sections profile where available, and the PGO/AutoFDO profile elsewhere (with
  `-function-splitting=all`). `createMachineFunctionSplitterPass()` and the
  `machine-function-splitter` pass name are removed;
  `createBasicBlockSectionsPass()` takes a `SplitWithPGO` argument instead.

* Removed the legacy pass manager's `RegionPass` and `RGPassManager` classes,
  which no longer had any users.

### Changes to building LLVM

* A new `LLVM_ENABLE_LZMA` option (`ON`, `OFF` or `FORCE_ON`; default `ON`)
  controls whether LLVM links liblzma for xz decompression. It replaces LLDB's
  `LLDB_ENABLE_LZMA`, which is deprecated: a monorepo build maps it onto
  `LLVM_ENABLE_LZMA`, and it has no effect in a standalone LLDB build.

* The DirectX backend is now an official target and has moved from
  `LLVM_ALL_EXPERIMENTAL_TARGETS` to `LLVM_ALL_TARGETS`. It is now built by
  default and no longer requires `LLVM_EXPERIMENTAL_TARGETS_TO_BUILD`.

* Clang and MLIR projects enabled implicitly as Flang dependencies now omit
  unrelated build and test targets. Installation retains the dependency
  libraries, headers, resources, and CMake targets needed by Flang. Explicitly
  enabling Clang or MLIR retains the project's complete build, test, and
  install behavior.

* With `CLANG_ENABLE_CIR=ON` and `mlir` in `LLVM_ENABLE_PROJECTS`,
  `find_package(Clang)` now looks for the associated MLIR CMake package
  before importing Clang's targets, so consumers no longer need to call
  `find_package(MLIR)` themselves and can do so in either order.
  As a consequence the consumer's project also sees the `MLIR_*` variables and
  targets, as it already does for Flang. When MLIR is only an implicit ClangIR
  dependency, its build-tree `MLIRConfig.cmake` now reports the package as not
  found with an explanatory message instead of succeeding with no targets;
  such a build never provided a usable MLIR SDK.

* When Clang is in the `LLVM_ENABLE_PROJECTS` list, it now compiles the
  experimental MLIR-Generator ClangIR by default. This functionality can
  increase the compile time and binary size of Clang significantly.  This can be
  disabled with `CLANG_ENABLE_CIR=OFF`, which wil disable the `-fclangir` flag
  in Clang.

* LLVM's documentation has largely been rewritten from [reStructuredText] to
  Markdown, and our Sphinx documentation build now has a hard dependency on the
  [`myst-parser` package]. Vendors packaging LLVM will need to install
  `myst-parser` to generate HTML or man page documentation. For convenience, we
  now release a `llvm_man_pages-${VER}.tar.xz` tarball if you need man page
  docs on a minimal system without Sphinx or `myst-parser`.

[reStructuredText]: https://devguide.python.org/documentation/markup/
[myst-parser package]: https://pypi.org/project/myst-parser/

### Changes to the Windows installer

* The project has migrated to MSI installers. Previous installations of LLVM,
  prior (and including) 23.1.0, must be manually uninstalled first, before
  installing this new release.

### Changes to TableGen

* `!cond` operator short-circuits at the first `true` condition.  Subsequent
  `condition : value` pairs, along with their corresponding side effects,
  are left unresolved.

### Changes to Interprocedural Optimizations

- Interprocedural passes no longer rewrite the signature of functions marked
  `optnone`, so their argument list, return type, and calling convention are
  preserved. Interprocedural analysis and transformation of such functions is
  otherwise unaffected.

- The IR Outliner has been removed, due to lack of a maintainer and the presence
  of correctness issues.

### Changes to Vectorizers

### Changes to the AArch64 Backend

* Added support for C2-Pro and C2-Ultra CPUs.
* Added support for hardening return address signing against PACMAN attacks.
  Functions with the `"sign-return-address-harden"="load-return-address"`
  attribute perform a load from the return address before returning, reducing the
  cache side channel used to guess pointer authentication codes.

* The SelectionDAG Darwin ABI lowering of function arguments which are
  aggregates passed by value containing small integers less than 32 bits in
  size has been made consistent with the GlobalISel lowering of such arguments.
  This is an ABI-breaking change but is unlikely to have any observable effect
  from higher-level languages compiled through clang.

* Assembler/disassembler support has been added for Armv9.8-A (2026)
  architecture extensions.

* Added support for the `aarch64-unknown-uefi` target. It follows the Windows
  ARM64 ABI (calling convention, callee saved registers, stack probing and SEH
  unwind information) and produces PE/COFF objects.

### Changes to the AMDGPU Backend

* Replaced `xnack` and `sramecc` target features with `amdgpu.xnack`
  and `amdgpu.sramecc` module flags.
* `llvm.amdgcn.make.buffer.rsrc` now accepts any integer width for its
  `numRecords` argument to account for targets that use 32-bit and 45-bit
  `numRecords` widths more accurately. If an integer of the incorrect width
  is used, it will be zero-extended or truncated as needed.

* These intrinsics have been removed in favour of `llvm.amdgcn.ballot`:
  * `llvm.amdgcn.icmp`
  * `llvm.amdgcn.fcmp`

### Changes to the ARM Backend

* Using the hard-float procedure call standard without floating-point registers
  is now an error. Previously this would fall back to the soft-float PCS while
  still emitting the hard-float ABI attribute tag.

### Changes to the AVR Backend

### Changes to the DirectX Backend

* The DirectX backend has been promoted from experimental to an official,
  fully supported LLVM target.

### Changes to the Hexagon Backend

### Changes to the LoongArch Backend

### Changes to the MIPS Backend

### Changes to the PowerPC Backend

### Changes to the RISC-V Backend

* Added experimental MC support for the ACLIC v0.20 extensions: `Smidctrl`,
  `Ssidctrl`, `Smnip`, `Ssnip`, `Smijt`, `Ssijt`, `Smehv`, `Ssehv`, `Smcsps`,
  `Sscsps`, `Smip`, and `Ssip`.
* Adds experimental assembler/CodeGen support for the `Zilx` (Indexed Integer
  Load) extension.
* Bump Svukte extension to 1.0.
* Remove experimental from Zicfiss.
* Added support for `Sspmp`, `Sspmpen` and `Smpmpdeleg` extensions.
* Removed veyron-v1 processor definition and tuning model.
* Removed support for the `Ventana Conditional Operations` extension.
* Added support for `tail symbol, rt` form that takes an address (materialisation)
  register, that is used when software guarded branch is needed.
* Updated the experimental `Zvzip` extension to the v0.3 draft specification.
* Added the `RVA23P1S64` and `RVB23P1S64` profiles (version 1.0).
* Updated the canonical order of one-letter RISC-V extensions to match the
  latest specification, placing ``p`` after ``v`` and removing unused ``n``.
* Adds experimental assembler support for the `Xqccmi` (Qualcomm 16-bit Instruction Lookup Table) vendor extension.
* Added `-mcpu=gaisler-gr765` for the 64-bit GR765 processor.
* Added `-mcpu=tt-ascalon-xg` for the Tenstorrent Ascalon XG processor, the
  global variant of Ascalon X without `Zvkng` and with reduced vector FP64
  throughput.

### Changes to the WebAssembly Backend

* Added support for emitting common symbols (.comm) using the WASM_SYMBOL_BINDING_COMMON
  flag (see https://github.com/WebAssembly/tool-conventions/pull/267)
* Added `@llvm.wasm.memory.copy` and `@llvm.wasm.memory.fill` intrinsics for
  the WebAssembly `memory.copy` and `memory.fill` instructions.

### Changes to the Windows Target

### Changes to the X86 Backend

* Added assembler and code generation support for the `AVX10_V2_AUX`
  instruction set.
* The AMX intrinsics that name tile registers (`llvm.x86.tileloadd64`,
  `llvm.x86.tdpbssd` and the others outside the `_internal` forms) now declare
  their memory effects: they read or write the tile state as `target_mem0`,
  and the memory operations access only memory through their pointer
  argument. Before, each one could read and write any memory, so loads of
  loop-invariant values weren't hoisted out of loops of tile operations.

### Changes to the OCaml bindings

* Removed the `size_of` and `align_of` functions. Create a constant based on
  the result of `DataLayout.abi_size` or `DataLayout.abi_align` instead.

* `DataLayout` has been moved from `Llvm_target` to `Llvm`.

* `data_layout` now returns a `DataLayout` instead of a `string`. Similarly
  `set_data_layout` now accepts a `DataLayout` instead of a `string`. You can
  use `DataLayout.of_string` and `DataLayout.as_string` to convert between them.

* `const_gep` and `const_in_bounds_gep` have been removed in favor of
  `const_ptradd` and `const_ptradd_from_indices`. Both create `getelementptr i8`
  constant expressions, the former using an integer offset, and the latter using
  a data layout, base type and index sequence. The latter API returns an option,
  as it may fail if the indices cannot be converted into ptradd representation.

* The `llcontext` argument of `builder_at`, `builder_before` and
  `builder_at_end` has been removed. These functions now take only an insertion
  point, instruction, or block, respectively. The context is implied by the
  insertion point.

* `builder` now takes an `llmodule` argument, instead of `llcontext`.

### Changes to the Python bindings

### Changes to the C API

* `LLVMAlignOf()` and `LLVMSizeOf()` have been deprecated. Create a constant
  based on the result of `LLVMABIAlignmentOfType()` or `LLVMABISizeOfType()`
  instead.

* Bindings operating on data layout (`LLVMTargetDataRef`) have been moved
  from `Target.h` (`Target` library) to `Core.h` (`IR` library).

* `LLVMConstGEP2()`, `LLVMConstInBoundsGEP2()` and
  `LLVMConstGEPWithNoWrapFlags()` have been deprecated.
  `LLVMConstPtrAdd()` and `LLVMConstPtrAddFromIndices()` can be used instead.
  Both create `getelementptr i8` constant expressions, the former using an
  integer offset, and the latter using a data layout, base type and index
  sequence. The latter API may fail if the indices cannot be converted into
  ptradd representation.

* Added `LLVMIsDSOLocal()` and `LLVMSetDSOLocal()` to query and set the
  `dso_local` runtime preemption specifier on global values (global variables,
  functions and aliases).

* Deprecated `LLVMCreateBuilderInContext()` in favor of
  `LLVMCreateBuilderForModule()`, which takes a `LLVMModuleRef` instead of
  `LLVMContextRef`.

### Changes to the CodeGen infrastructure

* Fixed a crash
  ([#214750](https://github.com/llvm/llvm-project/issues/214750)) when
  compiling a function containing a static alloca of `(size_t)-1` bytes, whose
  size collided with the sentinel value MachineFrameInfo used to mark dead
  stack objects.
* Fixed a crash
  ([#204079](https://github.com/llvm/llvm-project/issues/204079)) in the
  SelectionDAG pre-RA schedulers when they tried to unfold a load-folded
  instruction to break a physical register dependency and the unfolded load
  already existed in the DAG.
* Fixed a crash
  ([#220959](https://github.com/llvm/llvm-project/issues/220959)) when
  compiling a `landingpad` whose result type is not a struct of an exception
  pointer and an integer selector (for example `{}`). Such a landingpad is now
  rejected with a clean "unsupported" diagnostic instead of an assertion
  failure.

### Changes to the Metadata Info

### Changes to the Debug Info

### Changes to the LLVM tools

* `opt` and `llc` accept `-plugin-arg=<plugin>,<arg>`, which passes `<arg>` to the new `PassPluginLibraryInfo::ParseArguments` callback of the pass plugin named `<plugin>`.
  A plugin that defines `cl::opt` has to call `cl::ParseCommandLineOptions` itself inside `ParseArguments`.
  `LLVM_PLUGIN_API_VERSION` is now 3.

* `opt` and `llc` load `-load-pass-plugin` plugins after parsing the command line, so a loaded plugin's options are no longer accepted as ordinary options.
  Pass them with `-plugin-arg=<plugin>,<arg>`.

* llvm-offload-binary can now compress packaged binaries using zstd or zlib.

* llvm-mca no longer defaults -mcpu to "native"

* llvm-rc now supports `/showIncludes` to report header and resource-file
  dependencies in a format compatible with Ninja's `deps = msvc` mode.

### Changes to LLDB

* `platform.plugin.wasm.runtime-args` now precede the port argument on the Wasm
  runtime's command line instead of following it. A runtime that dispatches on a
  leading subcommand can therefore name that subcommand through this setting,
  rather than needing a wrapper script.
* MiniDebugInfo (the ELF `.gnu_debugdata` section) is now decompressed by LLVM
  rather than by LLDB's own liblzma binding, and is enabled with
  `LLVM_ENABLE_LZMA` instead of the deprecated `LLDB_ENABLE_LZMA`.

#### SBAPI

* A [bug](https://github.com/llvm/llvm-project/issues/211787) involving SBValues
  representing a register set was fixed. The methods `GetIndexOfChildWithName`
  and `GetChildMemberWithName` were incorrectly looking up values in all
  register sets. This meant that `GetIndexOfChildWithName` could return an index
  greater than the size of the set, and that `GetChildMemberWithName` could
  return values that were actually in a different set. Both methods are now fixed
  so that they are limited to the registers within the register set. Scripts
  using these methods may have to be updated as a result.

#### Windows

* Python 3.11 or later is now required for building LLDB 24 on Windows.
* For better performance, LLDB now turns off the Windows debug heap by default when debugging.
  If you need the debug heap enabled, set `platform.plugin.windows.disable-debug-heap` to `false`.

### Changes to BOLT

### Changes to Sanitizers

* AddressSanitizer's `operator new` now calls the current
  `std::new_handler` on allocation failure, as the C++ standard
  requires. With `allocator_may_return_null=1`, throwing `operator new`
  throws `std::bad_alloc` instead of aborting (on runtimes built with
  exceptions), and nothrow `operator new` returns `nullptr`. By default
  it still aborts once the handler chain is exhausted.

### Other Changes

* `cas::ObjectStore::getMemoryBuffer()` was documented as returning a buffer
  whose lifetime is independent of the CAS, but the buffer it returns may alias
  storage the CAS owns and so cannot outlive it. The documentation now matches
  the behavior, and the new `getStandaloneMemoryBuffer()` provides a buffer that
  does stay valid after the `ObjectStore` is destroyed.

## External Open Source Projects Using LLVM {{env.config.release}}

## Additional Information

A wide variety of additional information is available on the
[LLVM web page](https://llvm.org/), in particular in the
[documentation](index.md) section.  The web page also contains
versions of the API documentation which is up-to-date with the Git version of
the source code.  You can access versions of these documents specific to this
release by going into the `llvm/docs/` directory in the LLVM tree.

If you have any questions or comments about LLVM, please feel free to contact
us via the [Discourse forums](https://discourse.llvm.org).
