[GVN] Skip `areCallValsEqual` in MSSA-path when phi-translating read-only calls (#247989)
For read-only calls, the VN expression that GVN creates consists of the
callee and the value numbers of the arguments. When using MSSA,
`addMemoryStateToExp` appends to the expression the memory state
of the call too, i.e., the most recent write that may have changed the
memory the call reads.
Therefore, when the VN expression of a read-only call is phi-translated
into a predecessor, and it matches the expression of an existing call,
the two are already known to be equal and no further `areCallValsEqual`
check is needed.
[flang][OpenACC] Record loop locations for `acc.loop` without bounds (#248060)
Loop locations were collected while processing loop bounds or
privatizing induction variables. An `acc.loop` lowered without bounds
from a `DO CONCURRENT` or a `DO WHILE` therefore got an `#acc.loop_loc`
with an empty loop list. That list printed as `loops = >`, which does
not parse, so printing such IR with debug information and reading it
back failed.
Collect the loop locations in one place for both cases: one location per
`DO` in the nest, or the location of the `DO` statement of a `DO
CONCURRENT` or `DO WHILE`.
Assisted-by: Claude Code (Claude Opus 5.5)
acpi: acpivar.h: Include ACPICA's acpi.h, remove the latter in consumers
<dev/acpica/acpivar.h> uses types from
<contrib/dev/acpica/include/acpi.h>, so have it include it directly.
This allows removing that include, and in passing some superfluous
includes from sys/contrib/dev/acpica/include, from all source files
including <dev/acpica/acpivar.h>.
Reviewed by: imp, jaeyoon
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D62103
[RISCV] Hoist invariant VSETVLI from ratio-only loop entries (#248021)
`doPRE` in the VSETVLI insertion pass bailed out when a block's entry
state was only known by its SEW/LMUL ratio. That is the common shape of
a loop whose preheader and backedge agree on AVL and VLMAX but differ in
VTYPE, so the loop body kept a `vsetvli` that only needed to execute
once in the preheader.
Use the header's exit state as the PRE candidate and let the existing
predecessor, edge and simulation checks decide. The header must be
invariant under that state, so the rest of the loop's dataflow is
unchanged.
This covers single-block loops as well as loops with a separate latch or
a diamond body. Non-loop joins with a ratio-only entry also benefit when
one predecessor already provides the needed state.
Assisted-by: TRAE CLI (GPT-6)
linuxulator/powerpc: move syscalls out of the 32-bit only slots
On powerpc64 select() is syscall 142, getrlimit() is 190 and umount2() is
52. We had them at 82, 76 and 22, which are 32-bit only. Linux programs
couldn't unmount anything.
mmap2 is 32-bit only as well. Use linux_mmap2() for mmap like amd64 and
arm64 do and remove our copy of it.
Reviewed by: jhibbits
Differential Revision: https://reviews.freebsd.org/D62273
rtld: preserve the FP and vector registers in __tls_get_addr() on powerpc64
LLVM assumes that __tls_get_addr() clobbers only r0, r4-r12, LR, CTR,
CR0, CR1 and CR5-CR7 (the GETtlsADDR pseudo in PPCInstr64Bit.td), as
glibc's implementation guarantees, and keeps live values in the other
registers across the call. Our slow path, which runs on the first
access to the TLS block of a dlopen()ed object, copies the TLS
initialization image with the generic memcpy() and memset(), which
clang vectorizes: for a 130-byte block they clobber vs0, vs1, v0, v2,
v3 and v5 on powerpc64le and v2, v4 and v5 in a POWER9 powerpc64 build.
Qt's QBindingStorage constructor zeroes vs0, calls __tls_get_addr() and
then stores vs0 into the object, so the first QObject created by a
process that dlopen()ed libQt6Core gets 0xffffffff in its binding
storage pointer and crashes on destruction; this is why devel/pyside6
cannot generate QtGui.pyi on powerpc64le.
Keep the fast path as it is and run the slow path through a trampoline
that saves and restores the volatile floating-point and vector
[13 lines not shown]
misc/opencode: update to 2.4.4
- Update to 2.4.4 and bundled OpenTUI 0.9.12.
- Rebase the FreeBSD watcher patch onto the reworked native layer in 2.4.4
(Layer.effect + FiberSet); the FreeBSD snapshot/poll behaviour is
unchanged.
- The opencode-pty daemon (0.6.0, protocol 9), fff 0.10.5 and Ghostty v1.4.0
pins are unchanged, and the remaining patches apply unchanged.
[RISCV] Keep selects with cheap branchless lowering (#246339)
Do not let SelectOptimize convert integer selects that SelectionDAG
lowers to native min/max, sub+minu, or a single czero. This covers
narrow integers and pointers that fit one GPR.
Selects with branch weights or shared conditions still use the existing
profitability heuristics.
Fixes #246338
Assisted-by: TRAE CLI (GPT-6.2-Sol)
[BasicAA] Require a precise size in the errno size rule (#248308)
`aliasErrno()` returns `NoAlias` when the location is larger than an
`int`, checking only `Loc.Size.hasValue()`. That is also true for an
upper-bound size, which does not give the size of the access: a masked
load of `<4 x i32>` with only lane 0 enabled has location size
`upperBound(16)` but reads 4 bytes, which may be errno. GVN then
forwards a load of errno across a call that writes it.
Require `Loc.Size.isPrecise()` instead.
Fixes #248307.
Assisted-by: Claude Code
[mlir][acc] Read 128-bit values in `acc.atomic.read` with `cmpxchg`
`acc.atomic.read` reads `x` with an `atomicrmw or` of zero on an integer
of the size of `x`. For a `complex<f64>`, that is an `i128`, which
the LLVM dialect verifier does not accept for integer operations of
`atomicrmw` ([LLVMMemoryOps.cpp#L509-L511][verifier]):
```mlir
acc.atomic.read %v = %x : !fir.ref<complex<f64>>, !fir.ref<complex<f64>>, complex<f64>
```
failed with:
```
'llvm.atomicrmw' op expected LLVM IR integer type
```
Read values wider than 64 bits with a `cmpxchg` of zero with zero
instead, and take the loaded value. It only stores zero where the value
[11 lines not shown]
[mlir][acc] Fix `acc.atomic.capture` lowering when `v` and `x` differ in type
The `acc.atomic.read` in an `acc.atomic.capture` allows `v` and `x` of
different types, like a standalone `acc.atomic.read`, and the captured
value is converted to the type of `v`. The LLVM lowering stored the
captured value into `v` without converting it. For example:
```mlir
acc.atomic.capture {
acc.atomic.read %v = %x : !fir.ref<i32>, !fir.ref<f64>, f64
acc.atomic.write %x = %val : !fir.ref<f64>, f64
}
```
stored the `f64` value into the 4 bytes of `v`:
```mlir
llvm.store %old, %v : f64, !llvm.ptr
```
[6 lines not shown]
[mlir][acc] Fix `acc.atomic.read` lowering when `v` or `x` is complex
`acc.atomic.read` allows `v` and `x` of different types, and the value
read from `x` is converted to the type of `v`. The LLVM lowering
converted between the types used for the atomic access, where a complex
value is an integer of the same size. So a complex `x` was converted as
an integer, and a complex `v` was the target of an integer conversion.
For example:
```mlir
acc.atomic.read %v = %x : !fir.ref<f32>, !fir.ref<complex<f32>>, complex<f32>
```
was lowered to
```mlir
%rmw = llvm.atomicrmw _or %x, %zero monotonic : !llvm.ptr, i64
%val = llvm.sitofp %rmw : i64 to f32
```
[24 lines not shown]
[Driver][Sparc] Pick the -A assembler flag from the CPU's features (#247842)
getSparcAsmModeForCPU() had its own CPU name table, separate from the
features Clang compiles for. It missed CPUs like v7 and myriad2, gave
ultrasparc and ultrasparc3 the plain -Av9/-Av8plus, and ignored -mvis*
and -mv8plus.
Pick the flag from the CPU's features in the SPARC TargetParser, with
the -mvis*, -mv8plus and OS default changes applied, so the external
assembler accepts the instructions the compiler can emit:
- ultrasparc gets -Av9a / -Av8plusa and ultrasparc3 gets -Av9b /
-Av8plusb, as GCC does.
- niagara4 gets -Asparc4, as GCC does.
- v7 gets -Av7, and myriad2 gets -Aleon like the other Myriad 2 CPUs.
- -mno-vis and -mvis3 change the flag, and so does -mv8plus.
sparclite and sparclet have no features of their own, so they are
still matched by name.
Assisted-by: Claude Opus 5.5
fusefs: implement pathconf
fusefs used spec_pathconf() which returns EINVAL for _PC_NAME_MAX
and others, so getconf NAME_MAX fails on a FUSE mount and pjdfstest
can't run at all.
Add fusefs_pathconf() based on ufs_pathconf().
Other _PC_ names can be added when needed
OK helg@
[MemCpyOpt] Preserve inline flag when creating memset (#247407)
MemCpyOpt creates a regular memset when replacing a memset.inline or
memcpy.inline, which breaks the guarantee that no external function is
called. Create a memset.inline in these cases instead.
update ntfs-3g to 2026.11.23, security release
Regen patches and improve groupmember while there:
- add a header comment like the other systems
- use kvm_getprocs instead of raw sysctl as it retries when the
table grows and does not leak
- fix an out-of-bounds read of the process table when the tid is
not found, by swapping the && operands of the loop condition
Also drop --enable-mount-helper as mkfs.ntfs and mount.* are Linux
names and the mount.* links were installed outside PREFIX
feedback from sthen@
ok renaud@, helg@ (maintainer)
[TableGen][Decoder] Emit 2-argument RegClassByHwMode decoders for bits<0> (#247448)
Operands with a bits<0> encoding call their decoder with two arguments
(Inst, Decoder), so targets using RegClassByHwMode on bits<0> operands
currently have to hand-write a 2-argument overload in the anonymous
namespace to avoid hiding by the TableGen-generated 4-argument overload.
Track bits<0> operand decoders separately and emit the 2-argument
RegClassByHwMode dispatcher when referenced, forwarding to the member
register classes' 2-argument decoders.
Assisted-by: AI tooling
Pull-Request: https://github.com/llvm/llvm-project/pull/247448
[TableGen][Decoder] Only emit used RegClassByHwMode decoders (#247447)
Track which operand decoder methods are referenced by decoded encodings
before emitting the default RegClassByHwMode dispatchers, skipping any
that are unused (such as classes only decoded via custom operand or
instruction decoders). This lets us drop [[maybe_unused]] on the
emitted decoders and remove the unused stub decoders in MipsDisassembler.
Assisted-by: AI tooling
Pull-Request: https://github.com/llvm/llvm-project/pull/247447
[llvm-exegesis] Use raw syscall for memfd_create (#248351)
There are apparently some buildbots that use a glibc <2.27 which is the
first version to introduce memfd_create. This was released a couple
years after the first Linux kernel version to support memfd_create, so
just use the raw syscall for now as we do in other places.
*/*: Bump PORTREVISION for known Qt private API abusers
Qt 6.12.1 edition.
These ports are known to directly use or link to a library that uses the
Qt private API and must be rebuilt with every Qt update.
Qt *public* API/ABI compatability is excellent, so most consumers don't
need to necessarily be rebuilt between patch or even minor releases, but
use of the private API breaks this compatibility between even patch
releases and its use is highly discouraged.
This list [1] is based on histortical data. We don't have time to
revisit every port on the list with each Qt update, so if your port has
dropped Qt private headers and was bumped in error, please remove it
yourself if you have write access to the Wiki or alert someone on kde@.
[1] https://wiki.freebsd.org/KDE/Qt
x11-toolkits/pythonqt: Mark BROKEN
Does not build with Qt 6.12, but upstream PR
https://github.com/MeVisLab/pythonqt/pull/376
might fix it.
I'll do a followup on it, but this is a leaf
library and was getting in the way of the Qt
update.