[LiveDebugVariables] Repair stale SlotIndexes
The analysis keeps its indexes from before the first register allocator
until DBG_VALUEs are emitted, by which point passes in between have
erased some of the instructions they point at. Resolve them at the
start of each allocator run and before emitting.
SlotIndexes can then reclaim the entries of erased instructions without
sparing the ones held here, which would have made generated code depend
on -g. Emitted locations are unchanged, except that intervals resolving
to one position now emit a single DBG_VALUE rather than identical
consecutive ones.
[SlotIndexes] Add queries for stale indexes
An erased instruction leaves its index list entry in place, making the
index indistinguishable from a block boundary entry. Add
isBlockBoundaryIndex() and isStaleIndex() to tell the two apart, and
canonicalizeIndex() to resolve a stale index to the closest preceding
instruction's register slot, or the block start if none survives.
NFC. No caller yet. LiveDebugVariables is next.
[VPlan] Add more generic VPCostContext::getCostDivisor (NFC). (#225413)
Replace getReplicateRegionCostDivisor with more general getCostDivisor,
which takes a frequency directly.
The frequency lookup is now done at the 3 call sites, which all have the
region at hand.
Will also be used in https://github.com/llvm/llvm-project/pull/196845.
PR: https://github.com/llvm/llvm-project/pull/225413
Implement vmemdup_{array}_user
This is what FreeBSD now does for memdup_user and memdup_array_user
(which is wrong for memdup, but correct for vmemdup).
The amdgpu DRM driver started this in Linux ~6.12.86+
Reviewed by: wulf
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D57444
(cherry picked from commit 302c6d25da6907ec762ff8937fa86d380743b000)
linuxkpi: Define `DEFINE_CLASS()` and `CLASS()`
`DEFINE_CLASS()` is in fact named `LINUXKPI_DEFINE_CLASS()` because it
conflicts with `DEFINE_CLASS()` defined in <sys/kobj.h>.
This macro defines a type and a pair of constructor/destructor
functions.
They are to be used by `CLASS()`: this one declares a variable,
initialise it with the constructor and set the `__cleanup()` attribute
to call the destructor once the variable goes out of scope.
The DRM drivers generic code started to use `CLASS()` in Linux 6.13. It
requires the `fd` class to be defined in <linux/file.h>.
Reviewed by: bz
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57583
(cherry picked from commit f2a2e02ae54b836d1e23648756a050406f65111e)
SelectionDAG: Don't pad the source of ADDRSPACECAST if it's legal. (#225390)
With this use case `%out = addrspacecast <2 x ptr> %in to <2 x ptr
addrspace(1)>` on z/OS, the res type is `v2i32` (illegal) and the source
type is `v2i64` (legal).
Padding the source up to `v4i64` makes it illegal on z/OS and breaks the
type legalization.
[GitHub] Avoid downloading outputs during Bazel tests when possible (#224725)
PR adds
[`--remote_download_outputs=minimal`](https://bazel.build/reference/command-line-reference#param-remote-download-outputs-1)
to bazel tests in CI. I noticed recently that `Bazel Build/Test` takes
~2m to run even when everything is cached. It looks like it's
downloading ~1GiB of artifacts from the remote cache. For example, in [a
recent
run](https://github.com/llvm/llvm-project/actions/runs/35147456695/job/104967035656):
```
[82,641 / 90,341] 1094 / 7245 tests; Linking external/+_repo_rules+llvm-project/flang/lib/Semantics/libFortranSemantics.a; Downloading external/+_repo_rules+llvm-project/flang/lib/Semantics/libFortranSemantics.a, 260.4 MiB / 288.7 MiB; 1s remote-cache ... (62 actions, 10 running)
[88,426 / 91,191] 1238 / 7245 tests; Linking external/+_repo_rules+llvm-project/mlir/mlir-reduce; Downloading external/+_repo_rules+llvm-project/mlir/mlir-reduce, 337.0 MiB / 344.6 MiB; 13s remote-cache ... (58 actions, 0 running)
[88,870 / 92,185] 1315 / 7245 tests; Linking external/+_repo_rules+llvm-project/mlir/mlir-query; Downloading external/+_repo_rules+llvm-project/mlir/mlir-query, 241.9 MiB / 264.2 MiB; 11s remote-cache ... (55 actions, 0 running)
...
Executed 0 out of 7245 tests: 7245 tests pass.
```
Using this flag saves ~20-30s on my machine. After this PR, the majority
[3 lines not shown]
amd64: add userspace control for disabling splitlocks
Thread can control it with sysarch(I386_SET_SPLITLOCK). The global
default is set with hw.splitlock_force.
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D59815
amd64: use WRMSRNS immediate form to update splitlock control, when available
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D59815
amd64: support for tracking per-thread 'disable splitlocks' state
If hw supports it, on atomic operation that requires exclusive ownership
of more than one cache line, #AC is generated.
The state is maintained as the arch-private TDF_MD_SPLITLOCK_AC flag.
The state is inherited on thread creation from the thread spawning the
new one. It is cleared on exec.
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D59815
amd64: handle #AC in kernel mode
Recover from it if PCB_ONFAULT handler is provided.
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D59815
x86: add definitions for the CORE_CAP and MEMORY_CTL MSRs
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D59815
amd64: add md thread flags word
Use a hole in struct mdthread.
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D59815
[llvm] Remove declarations without definitions (NFC) (#225320)
DataRecordHandle::create and DataRecordHandle::construct in
llvm/lib/CAS/OnDiskGraphDB.cpp: The unused definitions were removed on
November 24, 2025 in commit f21857313dfab543e66ef43b1aed43b685794a7c.
dwarf_linker::parallel::DwarfEmitterImpl::emitStringsImpl in
llvm/lib/DWARFLinker/Parallel/DWARFEmitterImpl.h: Added on May 20, 2023
in commit 5f2a7fa67e9b6081a1a750ecea1216d53287eaa0 without a definition
or any callers (only DWARFLinkerImpl::emitStringsImpl was defined).
dwarf_linker::parallel::SyntheticTypeNameBuilder::addOrderedName
(2-argument overload) in
llvm/lib/DWARFLinker/Parallel/SyntheticTypeNameBuilder.h: Added on
November 23, 2023 in commit b61ac4a88f934ab5c02ee2a4957fb1b9943e7a5d
without a definition or any callers.
pdb::GSIHashStreamBuilder::finalizePublicBuckets and
pdb::GSIHashStreamBuilder::finalizeGlobalBuckets in
[42 lines not shown]
contrib/atf: upgrade to 0.26
This new version gets contrib/atf in line with the published version of
the package up on [GitHub][github].
Please note that this release is a major update: it contains several
bugfixes and feature enhancements. Most were already present in the
FreeBSD src repo, but there were a large number of changes made in
addition to what was already present.
MFC after: 1 month
Merge commit '9c78088348bcf1059d82a62bb57a0746309d4312'
Conflicts:
contrib/atf/.cirrus.yml
contrib/atf/Makefile.am
contrib/atf/Makefile.in
contrib/atf/aclocal.m4
[47 lines not shown]
[mlir][arith] Add minimumnumf and maximumnumf operations (#221658)
Add `arith.minimumnumf` and `arith.maximumnumf`, following
`minimumNumber` and `maximumNumber` from IEEE 754-2019 and the
`llvm.minimumnum`/`llvm.maximumnum` intrinsics. They differ from the
existing `arith.minnumf`/`arith.maxnumf` only in their treatment of
signaling NaNs: the new ops deterministically return the non-NaN
operand, whereas minnumf/maxnumf may return either NaN or the other
operand.