[CodeGen] Repair LiveStacks before compaction (#244601)
SlotIndexes compaction unlinks the entries of erased instructions,
so nothing may still refer to one. LiveStacks did: spill slot
intervals survive between greedy runs, and their boundaries can sit
on instructions erased in between.
Such a boundary stops following renumbering, so overlapping slots
can look disjoint. StackSlotColoring then merges them, and one
spill clobbers the other.
Move such boundaries onto the preceding instruction before
compacting.
chinese/fandol: Remove port
- Upstream (CTAN) has declared the Chinese Fandol fonts obsolete
MFH: 2026Q4
(cherry picked from commit c1d314f775e1a6d80b09efe2e1e638d91748fc80)
clang: Avoid adding zero-call-used-regs attribute to main
Rather than removing the "zero-call-used-regs" attribute from main
when its body is emitted, don't add it when constructing main's
attributes.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
[orc-rt] Add AllocActionFunction::handleWithMethod (#245489)
AllocActionFunction::handleWithMethod wraps a pointer to a noexcept
member function for use as an allocation action handler. The resulting
handler takes the address of the target object (as an ExecutorAddr) as
its first argument, casts it to a ClassT*, and calls the method on it
with the remaining arguments. This mirrors
WrapperFunction::handleWithSyncMethod, and removes the need to write a
free-function trampoline for each method-based action:
class Registrar {
public:
Error registerRange(ExecutorAddrRange R) noexcept;
};
ORC_RT_SPS_ALLOC_ACTION_IMPL(
registrar_register, (SPSExecutorAddr, SPSExecutorAddrRange),
AllocActionFunction::handleWithMethod(&Registrar::registerRange));
[5 lines not shown]
LowerTypeTests: Only invalidate analyses of modified functions in DropTypeTests
Previously everything was invalidated on any changes, so even
invariant function analyses were discarded.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
[Mips] Fix DSP bitcasts between v2i16 and v4i8 (#245202)
v2i16 and v4i8 are both legal DSP vector types in the DSPR register
class, but MipsDSPInstrInfo.td only had bitconvert patterns between each
of them and i32/f32, so a bitcast between the two vector types failed to
select.
The bitcast is a no-op: both types are loaded and stored as a 32-bit GPR
word with element 0 at the lowest address on either endianness. Add the
two missing patterns, plus a test covering both directions on both byte
orders.
Fixes #245155
aq: build the module on arm64
The driver has no x86 dependency. It attaches and passes traffic on a
Raspberry Pi 5 with an AQC100 in its PCIe slot.
Reviewed by: adrian
Differential Revision: https://reviews.freebsd.org/D60462
Signed-off-by: Nick Price <nprice at FreeBSD.org>
aq: support a legacy INTx interrupt
aq(4) attached only with MSI-X. Without an MSI controller iflib falls
back to INTx, and attach failed with EOPNOTSUPP.
Accept IFLIB_INTR_LEGACY, program the controller for INTx, and add a
legacy filter. INTx is level-triggered and nothing auto-masks, so the
filter masks the vector before acknowledging it; iflib unmasks it via
IFDI_INTR_ENABLE once the queues are drained. All causes already map
to vector 0 in this mode. MSI stays unsupported: iflib never selects
it here, since these controllers advertise 32 messages.
Reviewed by: adrian
Differential Revision: https://reviews.freebsd.org/D60461
Signed-off-by: Nick Price <nprice at FreeBSD.org>
CloneFunction: Factor out pruned clone terminator folding (#245482)
Move the cleanup code after inlining unto a helper function which
will be reused in a future patch.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
bootpd: clamp the DHCP reply length to the packet buffer
A client could set the DHCP maximum-message-size option to a large
value; dovend_rfc1048() derived the reply length from it with no upper
bound, so the trailing bzero() of the vendor area ran far past the
MAX_MSG_SIZE packet buffer. A value >= 0x8000 read into a signed short
instead went negative and slipped past the length clamps, leaving
sendto() to read a huge length from the buffer.
Read msgsz unsigned and clamp the reply length to the buffer size.
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D61009
Signed-off-by: Nick Price <nprice at FreeBSD.org>
bootpd: clamp the DHCP reply length to the packet buffer
A client could set the DHCP maximum-message-size option to a large
value; dovend_rfc1048() derived the reply length from it with no upper
bound, so the trailing bzero() of the vendor area ran far past the
MAX_MSG_SIZE packet buffer. A value >= 0x8000 read into a signed short
instead went negative and slipped past the length clamps, leaving
sendto() to read a huge length from the buffer.
Read msgsz unsigned and clamp the reply length to the buffer size.
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D61009
Signed-off-by: Nick Price <nprice at FreeBSD.org>
acpi: set up the sysctl tree before acpi_machdep_init()
On amd64 and i386, acpi_machdep_init() adds hw.acpi.reset_video under
acpi_sysctl_tree. Since the tree moved to the end of attach, it no
longer exists at that point, so sysctl_add_oid() drops the node and the
sysctl documented in acpi(4) is missing. Found with KUBSAN.
acpi_machdep_init() cannot fail, so calling it after the tree does not
leave knobs behind on a failed attach.
Fixes: 7f031c9f6b9f ("acpi: Move sysctl tree set up at end of initialization")
Signed-off-by: Nick Price <nprice at FreeBSD.org>
Reviewed by: olce
Differential Revision: https://reviews.freebsd.org/D60797
acpi: set up the sysctl tree before acpi_machdep_init()
On amd64 and i386, acpi_machdep_init() adds hw.acpi.reset_video under
acpi_sysctl_tree. Since the tree moved to the end of attach, it no
longer exists at that point, so sysctl_add_oid() drops the node and the
sysctl documented in acpi(4) is missing. Found with KUBSAN.
acpi_machdep_init() cannot fail, so calling it after the tree does not
leave knobs behind on a failed attach.
Fixes: 7f031c9f6b9f ("acpi: Move sysctl tree set up at end of initialization")
Signed-off-by: Nick Price <nprice at FreeBSD.org>
Reviewed by: olce
Differential Revision: https://reviews.freebsd.org/D60797
[IR] Make InaccessibleMem a category rather than a location
The memory location `InaccessibleMem` has been used to express various
memory-like restrictions. It is used in many cases where no actual
access to memory occurs; the only purpose of this access is to impose
restrictions on the control flow. It does not specify a concrete reason
why the restrictions are needed, and all operations having such access
are subjected to the same restriction. Using more a specific property
than the generic access to `InaccessibleMem` can be profitable, and
sometimes `InaccessibleMem` undergoes splitting. Previously, `TargetMem`
accesses had been separated from `InaccessibleMem` and there is an
intention to separate the access to floating-point environment.
At the same time, the notion of `InaccessibleMem` is useful. In many
cases, the knowledge that the access cannot alias with any pointer is
enough for an algorithm. Considering all locations as a group may
simplify algorithms; they continue using functions like
`onlyAccessesInaccessibleMem`, although the set of tested locations can
vary.
[30 lines not shown]
Coroutines: Only invalidate analyses of lowered functions in CoroCleanup (#244810)
CoroCleanupPass already invalidates the analyses of the functions it
lowers, but then reported no preserved analyses, which clears every
cached function.
Also stop preserving CFG analyses for lowered functions, since noop
coroutine elision can change the CFG.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>