[SCCP] Only invalidate calls of a function when its return value is reset (#241671)
Fixes #241244.
When FunctionSpecializer resets the lattice of a function's return
value, SCCPInstVisitor::invalidate added every user of the function to
the invalidation list. That includes uses that only pass the function's
address, like `call @g(ptr @k)`. Nothing solves such a call again, so
its result stayed undef and IPSCCP folded it to undef.
Only direct calls of the function whose signature matches depend on its
return value, so invalidate now walks only those. The walk is separate
from the one for ordinary values.
security/tailscale: Update to 1.104.7.
- Update USES to imply dependency on go as intended by upstream
MFH: 2026Q4
(cherry picked from commit e331550286bcd1c78834bbfcd0368865a0a87cf4)
[RISCV][P-ext] Custom lower v8i8/v4i16 MUL on RV64. NFC (#242390)
Lower RV64 `v8i8`/`v4i16` multiplication through the existing
multiply-parts nodes and `PPAIRE`, extending the lowering used for
`v8i8` multiply-high operations. This replaces the nested machine
instructions in the TableGen patterns.
snd_uaudio: Do not touch mixer_lock when there is no mixer
Using the mixer lock unconditionally panics because the lock is
uninitialized on devices with no audio interfaces, for instance
MIDI-only keyboards.
Fixes: 9a00e0b8ca56 ("snd_uaudio: Do not use snd_mixer->lock as mixer_lock")
MFC after: 3 days
Sponsored by: The FreeBSD Foundation
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D61506
libc: Export timespec_getres(3) and add tests
timespec_getres() has been declared in <time.h> and built into libc,
but never listed in a symbol map. It is therefore local to libc.so,
and dynamically linked callers fail to link.
Reviewed by: ziaee, fuz, des
Approved by: fuz (mentor)
Fixes: 9b5d724cad10 ("libc: Add timespec_getres(3) as per C23.")
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D60799
(cherry picked from commit 3ac9299ee90cc7a6330c560d8c49d5151185f80e)
[llubi][NFC] Extract arithmetic and vector intrinsic helpers (#242610)
This PR factors division/remainder, vector reductions, and trailing-zero
element counting into dedicated helpers to make them reusable for later
VP implementation.
Extracted from #229351.
libc: Fix stack buffer overflow in cgetnext()
`cgetnext()` copies a capability record's name field into a fixed
1024 byte on-stack buffer (`nbuf[BSIZE]`) one character at a time,
but never checks that the write pointer stays within the buffer.
Therefore, a record name that is longer than `BSIZE` (either on a
single line, or accumulated across several `\`-continued lines as
the pointer is not reset amidst continuation) writes past the end
of `nbuf` and smashes the stack.
The name field is read directly from the capability file, so any
consumer of `cgetnext()`/`cgetfirst()` that processes an untrusted
`termcap(5)`- or `printcap(5)`-style database (e.g. `cap_mkdb(1)`,
`lpr(1)`, or any third-party caller) can be exposed and hence made
to corrupt the stack.
Reviewed by: fuz, dteske
Approved by: fuz (mentor), dteske (mentor)
MFC after: 1 week
[3 lines not shown]
geo/gdal: set DPB_PROPERTIES=parallel
that's 1500+ c++ files, builds much faster with multiple jobs, and is on
the way of lots of other monsters.
ok tb@
[Remarks] Return the error when the bitstream parser cannot enter a block
`BitstreamBlockParserHelperBase::enterBlock` tested the `Error` from `BitstreamCursor::EnterSubBlock` as a boolean and never consumed it. A container that ends right after a block header makes `EnterSubBlock` fail, and a build with `LLVM_ENABLE_ABI_BREAKING_CHECKS` then aborts with "Program aborted due to an unhandled Error" instead of reporting a parse error.
`enterBlock` now returns the error from `EnterSubBlock`, as the other bitstream readers do. The new test cuts a container written by the serializer after every 32-bit word and expects each prefix to fail. Without the fix it aborts in a build with ABI-breaking checks.
Assisted-by: Claude Code (Claude Fable 5.2)
[InstCombine] Fix miscompile in foldCmpLoadFromIndexedGlobal (#242608)
The index check `i & 8` to delay checking for out-of-bounds (for the bit
vector) indices causes miscompiles when a global larger than 64 elements have
interesting elements between e.g. indices 65 and the next time the condition is
checked, which is 73.
The guard was also slightly incorrect according to its documentation: it'd need
to be `i & 7` instead of `i & 8`.
It was also unnecessary: each iteration does constant evaluation and updates a
state machine represented as 6 variables. 5 integer checks at the end of such a
loop does not make it any more slower than it already is, and in the worst case
causes 7 extra constant evaluations and state machine updates before bailing
out.
[Remarks] Return the error when the bitstream parser cannot enter a block
`BitstreamBlockParserHelperBase::enterBlock` tested the `Error` from `BitstreamCursor::EnterSubBlock` as a boolean and never consumed it. A container that ends right after a block header makes `EnterSubBlock` fail, and a build with `LLVM_ENABLE_ABI_BREAKING_CHECKS` then aborts with "Program aborted due to an unhandled Error" instead of reporting a parse error.
`parseBlock` now calls `EnterSubBlock` itself and returns its error, as the other bitstream readers do. That leaves `enterBlock` without a job, so it is gone. The new test cuts a container written by the serializer after every 32-bit word and expects each prefix to fail. Without the fix it aborts in a build with ABI-breaking checks.
Assisted-by: Claude Code (Claude Fable 5.2)
[Remarks] Reject remarks of type Unknown in the bitstream parser
The bitstream remark parser only rejected type values above `Type::Last`, so a record with type 0, `Type::Unknown`, parsed as a valid remark. Writing such a remark as YAML reaches `llvm_unreachable("Unknown remark type")` in `YAMLRemarkSerializer.cpp`, which is how `llvm-remarkutil bitstream2yaml` crashes on a container with a zeroed type field. The YAML parser already rejects a remark without a type.
Reject type 0 with the existing "Unknown remark type." error. The new test serializes a remark without a type and expects that error.
Assisted-by: Claude Code (Claude Fable 5.2)
Verifier: Look up the AMDGPU metadata kinds once (#242573)
visitInstruction looked up two AMDGPU metadata kinds by name for every
instruction. Look up their IDs when constructing the Verifier.
O3 instructions in opt:
consumer-typeset z08.bc -0.34%, kimwitu++ k.bc -0.22%, sqlite3 -0.15%.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
Verifier: Check each metadata attachment of an instruction once (#242574)
visitInstruction looked up about 30 metadata kinds for every
instruction, followed by another getAllMetadata call. Collect the set
once and switch over the kinds.
instructions in opt: consumer-typeset z08.bc -0.94%,
kimwitu++ k.bc -0.64%, sqlite3 -0.43%, SPASS cnf.bc -0.09%.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
AArch64: Migrate to LastSubtargetCache in getSubtargetImpl (#242555)
These already reused the last subtarget for functions with the same
function attribute set. Use LastSubtargetCache to additionally filter
to the subtarget relevant attributes and work towards all targets
using a common pattern.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>