[PowerPC] Enable SlotIndexes compaction by default
Greedy measures live ranges in slot indexes, and instructions erased
before allocation (by PHI elimination, two-address lowering and the
coalescer) leave entries behind that make ranges look longer than
they are. Opt PowerPC in to dropping them, as AMDGPU and ARM do, so
allocation works with real distances. Passing
-greedy-compact-slot-indexes=false restores the old behaviour.
On CTMark (pwr8, pwr10, AIX, ppc32), .text and llc compile time move
by less than 0.03% and evictions drop by 1.5-5.8%.
The test updates are register allocation changes; csr-split.ll gets
back the live range split it was written to check.
[RISCV] Fix misaligned RVV stack objects
RVV stack objects were laid out from the top of the RVV area and then
shifted down by the area's alignment padding, so only the lowest
object was guaranteed its alignment. An over-aligned object above it
could end up at a misaligned address.
Lay the objects out from the end of the area that the base register
points at, most aligned first, and put the padding at the other end.
Each object is then at a multiple of its alignment from an aligned
base for any VLEN.
Fixes #246451
[RISCV] Precommit RVV stack alignment test (NFC)
Show the current frame layout when a more aligned scalable-vector
stack object has a lower frame index than a less aligned one. The
more aligned object is placed at an address that is not a multiple
of its alignment.
Precommit for #246451
CI install check: boot environments named after the build, home datasets (#706)
The installer names the boot environment after the version and build
(nextbsd/nextbsd-userland#674) and makes each home a dataset of its own
(nextbsd/nextbsd-userland#673). Accept both, and the old default name, so
the check passes before and after those land.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
[AArch64] Implement ACLE intrinsics for FPv2 SVE min/max instructions
ACLE PR: https://github.com/ARM-software/acle/pull/480
Implements the following intrinsics:
- svmaxmg / svminmg
- svmaxinm / svmininm
- svmaxmginm / svminmginm
Includes f16, f32, and f64 types, _m, _z, and _x predication and _n variants
AI assistance: Codex used for generating test cases
[AMDGPU] Defer S_WAITCNT_DEPCTR erasure and updates in expert mode
A pre-existing S_WAITCNT_DEPCTR was erased, or had its VA_VDST and
VM_VSRC fields relaxed, as soon as the incoming state made those waits
look redundant. In a loop header that happens on the first visit, before
the backedge adds the instructions of the loop body. The wait is then
lost when the header is visited again with them pending.
Keep the original operand of every S_WAITCNT_DEPCTR, including
duplicates, while iterating to the fixed point, and only apply the final
encoding or erase the instruction at the end of the pass.
Also reset the VA_VDST field of a duplicate S_WAITCNT_DEPCTR to "no
wait" once its wait has been folded into the first one, instead of
leaving a redundant copy of the combined wait behind.
Co-Authored-By: Claude Opus 5.5 <noreply at anthropic.com>
bhyve: disable SIGPIPE for IPC connections
Currently, if an IPC client (e.g. bhyvectl --get-vm-pid) exits
before reading the response, the VM crashes with SIGPIPE.
Set SO_NOSIGPIPE on a socket to prevent that.
While here, update other error paths in init_ipc_thread()
to return -1 on error instead of an error number to make error
handling consistent.
Reviewed by: markj
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D62000
pf: fix memory leak on failure in DIOCADDETHRULE
If we fail pf_nveth_rule_to_keth_rule() we jumped to
DIOCADDETHRULE_error, which doesn't free the rule.
Free the rule directly, because pf_free_eth_rule() expects the rules
lock to be held, and at this point we've only allocated the rule itself,
not any of the child objects.
Reported by: llm-postcr
Fixes: e732e742b37f ("pf: Initial Ethernet level filtering code")
Sponsored by: Rubicon Communications, LLC ("Netgate")
pf: fix NULL dereference on failure in DIOCADDETHRULE
If the ticket or anchor check in DIOCADDETHRULE fails
we pf_free_eth_rule() on a struct pf_keth_rule with NULL
ipsrc.addr.p.tbl/ipdst.addr.p.tbl. That ends up dereferencing that NULL
pointer.
Teach pf_free_eth_rule() to check for NULL in those fields so it's safe
to free a rule we're in the process of creating.
Reported by: llm-postcr
Sponsored by: Rubicon Communications, LLC ("Netgate")
[InstCombine] Drop poison-generating annotations from call in select-of-zero fold (#245874)
Fixes #245656.
`foldSelectZeroOrFixedOp` folds `select (x == 0), 0, op(x, y)` into
`op(x, freeze(y))`, which evaluates `op` unconditionally. If `op` is a
call (`umin`, `fshl`, `fshr`) with a `range` attribute that excludes
`0`, e.g. `range(i64 1, 0)` on the return value or an argument, the call
now returns a value outside its declared range at `x == 0`. The result
is poison where the original select produced `0`.
Drop the poison-generating annotations on call instructions. Non-call
ops (`mul`, `idiv`, etc.) keep their `nuw`/`nsw`/`exact` flags, since at
`x == 0`, `0 * y` cannot overflow and `0 sdiv/udiv y` stays exact.
Alive2 proofs:
- Return range dropped: https://alive2.llvm.org/ce/z/ZhgWuj
- Arg 0 range dropped: https://alive2.llvm.org/ce/z/dAKtZF
- Arg 1 range dropped: https://alive2.llvm.org/ce/z/D5URrH
[2 lines not shown]
[Mips] Fix the HI/LO hazard check on MIPS I to MIPS IV (#245689)
MIPS I to MIPS IV need two instructions between an mflo or mfhi and the
next instruction that writes HI or LO. handleMFLO() only knew about
mult, div and divu, so multu, dmultu, mthi and mtlo were missed, and
mflo followed by multu, as in a 64-bit multiply on O32, got no nops. It
also did not look at the instruction in a delay slot, so a div that the
delay slot filler placed in the delay slot of a branch right after an
mflo was missed as well.
Check the registers an instruction writes instead of a list of opcodes,
and look at the next two instructions that can execute after each mflo
or mfhi, including the instruction in a delay slot and the first
instructions of every successor block. Add the nops right before the
instruction that writes HI or LO when it is in the same block, or else
right after the mflo, or at the start of the successors when the mflo is
in a delay slot.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
games/linux-steam-utils: Fix launching games while Steam runs
Starting a game from a desktop entry runs a second steam instance.
Its cleanup ran lsu-kill, which killed the running Steam. The wrapper
now only hands its arguments to a running Steam and exits.
Steam still dropped those commands because of two FreeBSD differences,
now handled in steamfix.so:
- Reading an empty FIFO no writer has opened returns EAGAIN, not 0,
and Steam stopped reading steam.pipe after that error.
- semctl SETVAL and SETALL do not record the caller as sempid. Steam
took the 0 for a semaphore left by a dead instance and recreated
it, so its other threads and processes kept a removed ID.
[MemoryBuiltins] Remove more TLI support (#246418)
Remove TLI argument from getAllocAlignment() and
getInitialValueOfAllocation() and rely exclusively on
`allocalign`/`allockind` instead.
bhyve: fix bootorder for PCI slots >= 10
Currently, bhyve writes slots as decimals. Firmware such as EDK2
interprets them as hexadecimals, so slot 10 becomes 16, breaking
the configured boot order.
Reviewed by: markj
Fixes: 6632a0a4e3ab ("bhyve: add helper to create a bootorder")
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D61997
[AArch64] Implement ACLE intrinsics for FPv2 SVE min/max instructions
ACLE PR: https://github.com/ARM-software/acle/pull/480
Implements the following intrinsics:
- svmaxmg / svminmg
- svmaxinm / svmininm
- svmaxmginm / svminmginm
Includes f16, f32, and f64 types, _m, _z, and _x predication and _n variants
AI assistance: Codex used for generating test cases
[AMDGPU] Defer S_WAITCNT_DEPCTR erasure and updates in expert mode
A pre-existing S_WAITCNT_DEPCTR was erased, or had its VA_VDST and
VM_VSRC fields relaxed, as soon as the incoming state made those waits
look redundant. In a loop header that happens on the first visit, before
the backedge adds the instructions of the loop body. The wait is then
lost when the header is visited again with them pending.
Keep the original operand of every S_WAITCNT_DEPCTR, including
duplicates, while iterating to the fixed point, and only apply the final
encoding or erase the instruction at the end of the pass.
Also reset the VA_VDST field of a duplicate S_WAITCNT_DEPCTR to "no
wait" once its wait has been folded into the first one, instead of
leaving a redundant copy of the combined wait behind.
Co-Authored-By: Claude Opus 5.5 <noreply at anthropic.com>