[BPF] Mark reg-reg ADD/OR/AND/XOR/MUL as commutable (#234698)
BPF ALU instructions overwrite their first operand: `r0 += r4` means `r0
= r0 + r4`. In a loop like `sum = p[i] + sum`, the loaded `p[i]` is the
first operand, so the add must write its result into `p[i]`'s register.
The result is needed in `sum`'s register for the next iteration, though,
so LLVM copies `sum` aside, loads `p[i]` into `sum`'s register and adds
the copy back:
```
r4 = r0 ; copy sum
r0 = *(u64 *)(r1 + 0) ; load p[i] into sum's register
r0 += r4
```
Addition is commutative, so the add could just as well overwrite `sum`'s
register, which removes the copy:
```
[36 lines not shown]
upx: Update to version 5.2.1
==================================================================
User visible changes for UPX
==================================================================
Changes in 5.2.1 (27 Aug 2026):
* bug fixes - see https://github.com/upx/upx/milestone/24
Changes in 5.2.0 (08 Jun 2026):
* new format cpm86/cmd
* bug fixes - see https://github.com/upx/upx/milestone/23
Changes in 5.1.1 (05 Mar 2026):
* ELF: MIPS r3000 (32-bit) shared libraries are supported
* bug fixes - see https://github.com/upx/upx/milestone/22
Changes in 5.1.0 (07 Jan 2026):
* ELF: new format linux/riscv64
[61 lines not shown]
[BPF] Do not fold negative CO-RE memory offsets (#234253)
The CO-RE memory folding check accepts any local value at or below
INT16_MAX. A signed enumerator of -65540 is encoded as -4 in the
instruction. When the local and target values are both -4, libbpf
rejects the target value because it compares it with SHRT_MAX as an
unsigned integer.
Limit load and store folding to local values in [0, INT16_MAX].
Assisted-by: OpenAI Codex
[SelectionDAG] Don't crash after an error in a callbr's asm
When a callbr's asm has an error, such as a constraint it can't satisfy,
visitInlineAsm() reports it and returns before creating the INLINEASM_BR.
But the callbr's block still got edges to the indirect targets, which
BranchFolding rejects since nothing branches there, and a landing pad in
an indirect target looked for the registers that the INLINEASM_BR would
have defined.
Don't add the edges to the indirect targets, and make a landing pad's
value poison, since nothing reaches it.
Fixes #98379 and #172657. Part of #173609, whose asm is still rejected,
since LLVM picks the "k" alternative of "+kr", which needs AVX-512.
Assisted-by: Claude Opus 5.5
Update to iodine-0.9.0
With this release I couldn't reproduce the client/server issues I had
with 0.8. Drop our patches to force the use of arc4random(3) instead of
srand(3)/rand(3) - not sure if they were still useful anyway since our
rand(3) doens't respect srand(3) since some years already. Now upstream
detects and uses arc4random etc. This release also switches to meson
instead of a Makefile.
databases/py-pymssql: Resurrect, update to 2.4.5, add maintainer
The port expired on 2026-09-15 because it depended on the expired lang/cython0.
It now builds with Cython 3 (USE_PYTHON=cython) via pep517 from the PyPI sdist
and links databases/freetds dynamically. Direct krb5 and OpenSSL linking is
disabled. tomli and standard-distutils are pruned from the pyproject
build-system requires as they are not needed.
Co-authored-by: Michael Osipov <michaelo at FreeBSD.org>
PR: 299747
[SCEV] Prove monotonic predicates from loop entry
SCEV's isKnownOnEveryIteration proves a predicate on every iteration
of a loop by proving it on loop entry and on the backedge. The
backedge part often fails, e.g. when the loop exit only bounds the IV
from above.
Now, if the predicate compares a recurrence of the loop with a
loop-invariant value and can only change from false to true as the
loop runs, prove it from loop entry alone.
In iv-widen-elim-ext.ll, the comment on @foo3 said its zext must stay.
The zext is now removed: the add it extends is non-negative on every
iteration.
One exit truncation loses nuw: the exit test is now on the wide IV,
so IndVars rewrites it with a new truncation that has no nuw. It is
marked with TODO.
Co-Authored-By: Claude Opus 5.5 <noreply at anthropic.com>
[SCEV][NFC] Factor getMonotonicPredicate out of getLoopInvariantPredicate
Move the code that finds a monotonic predicate into a private utility.
For a compare of an AddRec against an invariant, it returns the
predicate with the AddRec on the left, and whether the predicate
turns to false or to true as the loop runs.
Co-Authored-By: Claude Opus 5.5 <noreply at anthropic.com>
[SCEV][NFC] Factor isKnownOnEveryIteration out of isKnownViaInduction
Move the check that proves a predicate on loop entry and on the backedge
from isKnownViaInduction into a private utility isKnownOnEveryIteration.
Co-Authored-By: Claude Opus 5.5 <noreply at anthropic.com>
[IndVarSimplify][NFC] Add tests for samesign compares of an IV
Add tests for folding a samesign compare of an IV with a loop-invariant
value, when the compared operands may have different signs on loop entry,
and so they can be poison.
Co-Authored-By: Claude Opus 5.5 <noreply at anthropic.com>
[LoopVectorize][NFC] Add tests for runtime checks with a widened IV index
In
if (start <u len && start - 32 <u len)
for (int32_t i = start; i < n; i++) a[i] = a[i - 32];
the distance between a[i] and a[i - 32] is always 32, but
if the vectorizer receives this loop with a widened IV to i64,
the vectorization is applied, but a runtime alias check is inserted
because widened loop may contain trunc/zext through which the
vectorizer cannot infer constant access distance.
If the loop IV is not widened, no runtime check is inserted.
Add tests for both forms.
Co-Authored-By: Claude Opus 5.5 <noreply at anthropic.com>
[IndVarSimplify][NFC] Add tests for IV facts known on entry
If an IV start is non-negative and the IV increments with nsw, it is
non-negative on every iteration.
SCEV can't prove this, so, for example, IndVars can't compute
i - 32 in i64 in
if (start >= 32)
for (int32_t i = start; i < n; i++)
use(zext(i - 32));
Add tests for it.
Co-Authored-By: Claude Opus 5.5 <noreply at anthropic.com>
[LoopUnroll] Count invariant non-SCEVable values once in full-unroll cost (#233638)
The full-unroll cost analysis already treats SCEV-invariant values as
free on all but the first simulated iteration, since they only need to
be computed once after unrolling. Values whose type is not SCEVable,
such as floating-point computations, were instead charged on every
iteration, which overestimates the unrolled cost of loops containing
invariant FP code (e.g. left behind in the loop by reassociation) and
can block profitable full unrolling.
Extend the invariance check to any instruction that does not access
memory, has no side effects, and whose operands are defined outside the
loop or are themselves such invariant computations.
Test more outputs that the indirect targets convert
Add the RISC-V shape of #143795, where an i32 output is sign-extended on
each path, a float in a specific physical register on x86, a double in a
pair of registers on i686, and a flag output on AArch64, whose NZCV is now
live into the indirect target. Also check that a callbr with direct and
indirect register outputs now only reports the error.
Assisted-by: Claude Opus 5.5