[DebugInfo][NFC] Refactor debug record salvage (#215971)
Split address and variable-location salvage into helpers so the ordering
and the kill fallback stay visible in salvageDebugInfoForDbgValues, with the
variable-location helper returning whether it processed the record.
Rename the locals and parameters the move touches to say what they hold, and use
isAddressOfVariable() for the two #dbg_declare tests, which is the same
comparison.
Replace the address helper's single-use template with DbgVariableRecord
and pass it the instruction the caller already checked, rather than
recovering it with a dyn_cast the caller's check already covers.
Add a unit test for the dbg.assign address path.
No regressions on check-llvm or check-lldb; ran about 80 auto-generated C tests with 225ish locations and no differences in DW_AT_location on aarch64 at O2.
Assisted by AI.
[CIR][SYCL] Device kernel caller (#213771)
During device compilation, emit a SYCL kernel caller offload entry point
in
place of each function declared with the sycl_kernel_entry_point
attribute,
mirroring classic CodeGen's `CodeGenModule::EmitSYCLKernelCaller`.
Depends on #213728
ixv: Support E610 mailbox API 1.6
E610 VFs no longer report the actual PF link state and speed through
VFLINKS. They can consequently report the default 10 Gb/s speed even
when the physical link uses another rate.
Negotiate mailbox API 1.6 on E610 and request the PF link state with its
three-dword operation. Retain VFLINKS as the fallback when an older PF
rejects API 1.6. Permit API 1.6 in the inherited xcast and queue
discovery helpers so negotiating the newer revision does not disable
existing operations.
Use GET_QUEUES to replace E610's one-queue fallback with the grant from
the PF. The common path continues to use one iflib queue set per data
MSI-X vector and caps the result at two queue pairs.
Preserve mailbox transport errors so the driver can distinguish an
explicit PF NACK from a transient timeout. A NACK means clear-to-send
state was lost and requires a VF reset. Preserve the last confirmed
[21 lines not shown]
ixv: Reject unsupported E610 Hyper-V VFs
E610 Hyper-V VFs use PCI configuration space communication instead of
the native PF/VF mailbox. The generic E610 match currently attaches
native mailbox operations to those devices, and the imported Hyper-V
subdevice identifier is incorrect.
Correct the subdevice identifier to 0x00ff, as used by DPDK shared
ixgbe code, and reject that subtype until ixv has a complete Hyper-V
operations table.
MFC after: 1 week
Sponsored by: BBOX.io
[SSAF][UnsafeBufferAnalysis] Filter out type-constrained pointers from reachable unsafe pointers (#209354)
Integrate the TypeConstrainedPointers analysis results into
UnsafeBufferReachableAnalysis. The final result is filtered to exclude
type-constrained pointers.
The pointer flow graph is untouched. Removing type-constrained pointers
from the graph would introduce unsoundness.
Final step for rdar://179151541 and rdar://179151882
linux: implement pkey_alloc, pkey_free and pkey_mprotect
Bridge the Linux memory protection key syscalls to FreeBSD's native
MPK support instead of returning ENOSYS. Modern Linux software
probes these at startup: Chromium-based browsers (found via
www/linux-brave) use protection keys for V8's heap and JIT
sandboxing, and glibc >= 2.27 exposes the full API.
pkey_alloc() allocates from a per-process bitmap kept in the process
emuldata (key 0 implicitly allocated, matching Linux's
mm_pkey_allocation_map; ENOSPC once keys 1..15 are exhausted or when
PKU is absent, as Linux returns on such hardware) and applies the
requested initial access rights to the calling thread's PKRU, located
in the XSAVE area via xsave_area_offset(). pkey_free() is
bookkeeping only: as on Linux, freeing neither untags pages nor
updates PKRU. pkey_mprotect() performs the protection change and
tags the range through amd64_pkru_update(), factored out of
sysarch(2)'s AMD64_SET_PKRU/AMD64_CLEAR_PKRU implementation so that
both share the same argument checking and map read lock
[33 lines not shown]
pci: Export pcie_flr_supported()
Move the capability and quirk checks used by pcie_flr() into a public
side effect free helper. This lets callers determine whether an FLR
can be attempted before quiescing a device or saving state.
The helper considers the advertised PCIe FLR capability and both the
enable and disable FLR quirks.
MFC after: 2 weeks
Sponsored by: BBOX.io
[APFloat][SelectionDAG] Support Float8E5M3FNU in convert.{to,from}.arbitrary.fp
Float8E5M3FNU was already accepted by the IR verifier, because
isValidArbitraryFPFormat is defined in terms of
getArbitraryFPFormatSizeInBits and that table covers it. It was missing
from getArbitraryFPSemantics, so SelectionDAGBuilder rejected
it with "not implemented format" and the verifier-clean IR failed to
compile. Add the mapping and the corresponding entries in the
expandCONVERT_{TO,FROM}_ARBITRARY_FP format allowlists.
Unlike every other format the expansions handle so far, Float8E5M3FNU is
unsigned: it has no sign bit, so all 8 bits go to a 5-bit exponent and a
3-bit significand.
Since an unsigned format cannot represent a negative value, a negative
input now saturates to zero when the saturate flag is set, and is poison
otherwise. -0.0 is excluded from that and still converts to +0, and the
check is ordered before the NaN case so a negative NaN still produces the
NaN encoding. APFloat treats constructing a negative value in an unsigned
[3 lines not shown]
[APFloat][NFC] Add unit test coverage for `getArbitraryFPSemantics` (#216501)
`isValidArbitraryFPFormat` and `getArbitraryFPFormatSizeInBits` have
unit tests, but `getArbitraryFPSemantics`, the mapping the conversion
intrinsics actually lower through, had none. Cover the formats it
supports, the valid formats it does not support yet, and invalid format
strings, and check that the two tables agree on the size of every format
with lowerable semantics.
Also add the missing Float8E5M3FNU case to the
`getArbitraryFPFormatSizeInBits` test.
[AArch64][GlobalISel] Do not create atomic truncstore (#216522)
After #213935 the i64->i32 truncstore was failing to create a COPY
correctly.
We do not have tablegen patterns, so mirror what SDAG does and do not
create
atomic truncstore.
[MIPS][NFC] test mips variadic aggregate handling (#216509)
mips64 has some bugs here that I'll address in a followup. The problem
is that we get `inreg {float}` items in the variable argument list. That
breaks for aggregates like `_Complex long double` or just `struct { long
double a; b }`.