[WebAssembly] Fix memory operand names for memory.copy in tablegen. NFC (#220115)
The first immediate is the destination memory index and the second is
the source memory index according to the WebAssembly specification and
`LowerMemcpy` in `WebAssemblyISelLowering.cpp`.
[sanitizer_common] Add operator new chain-handling framework (#201151)
Groundwork for #196388
[sanitizer_common] Add operator new chain-handling framework
Implement the operator new wrapper machinery required by
[new.delete.single]/3+/4 in shared sanitizer_common files so every
sanitizer can reuse it (avoids ~130 lines of duplication).
sanitizer_new_handler.h provides three main templates in namespace
__sanitizer (plus a NORETURN InvokeOnExhausted wrapper used internally):
* RunNewHandlerChain<Alloc>(alloc)
Runs std::get_new_handler() in a loop until either the
allocation succeeds or the chain is exhausted (returns nullptr).
* NewImplThrowing<Alloc, OnExhausted>(alloc, on_exhausted)
Throwing operator new: runs the chain; on exhaustion either
[66 lines not shown]
umtx: use a distribution-fair multiplier for the chain hash
umtxq_hash() multiplies the key by 0x9E370001 and keeps the high bits. That
constant is 0x9E37 * 2^16 + 1, so it degenerates for keys whose spacing carries
trailing zero bits: at a 64 KiB stride it puts 128 of 512 parked waiters onto a
single chain mutex, and at 16 KiB and up it uses only a handful of the 512
chains. Base-system consumers never hit this because libthr places its own wait
words 128 bytes apart, but a Linux-ABI runtime waiting on addresses it allocates
itself lands squarely on the floor. Switch to 0x61C88647, which leaves at most 3
waiters per chain at the same stride; Linux made this exact change in 2016, after
judging the sparse constants "actively bad for hashing".
Approved by: adrian (mentor)
Reviewed by: kib, adrian, emaste
Differential Revision: https://reviews.freebsd.org/D58337
Signed-off-by: Nick Price <nprice at FreeBSD.org>
[LV] Auto generate RISCV analysis tests. NFC (#219879)
This patch re-generate some analysis RISCV tests by automatic update
scripts to make tests easier to update.
update boswars to 2.8
Includes official Python 3 support, removes BDEP on scons and fixes the
included images so that we don't need to adjust them manually with optipng
anymore.
bxe(4): don't feed a zero page size to ilog2 during ILT init
FreeBSD's bxe hardwires CNIC_SUPPORT() to 0, so bxe_ilt_set_info()
never enters the block that initializes the SRC and TM ILT clients.
Those two clients are left zeroed (page_size 0, flags 0), yet
ecore_ilt_init_page_size() calls ecore_ilt_init_client_psz() for all
four clients unconditionally. For SRC and TM that evaluates
ILOG2(page_size >> 12), i.e. ilog2(0). On an INVARIANTS kernel ilog2()
asserts "ilog argument must be nonzero" and panics the machine the
first time the interface is brought up (bxe_init -> bxe_nic_load ->
bxe_init_hw -> ecore_ilt_init_page_size). On a non-INVARIANTS kernel
it silently programs a bogus page-size register instead.
Restore the else branch that upstream Linux bnx2x carries: when CNIC
is not supported, mark the SRC and TM clients with ILT_CLIENT_SKIP_INIT
and ILT_CLIENT_SKIP_MEM so ecore_ilt_init_client_psz() skips them.
Root-caused from a crash dump on a BCM57810 (device 0x168e): the ILT
clients showed CDU and QM populated and SRC and TM zeroed with no skip
[6 lines not shown]
Reland "[SSAF][clang-reforge] Add end-to-end clang-reforge tests (#219085)"
This reverts commit 459dffa2ef4af2e3fd96ff35a235a301bdeeb32c
The new test added in the original PR uses 'clang-apply-replacements'
conditionally now. It checks if the tool is available before using it.
When the tool is not there, it only checks against replacement offsets
and texts.
Final step of:
rdar://185840466
[VPlan] Compute SCEV for ptrtoaddr. (#219848)
SCEV models ptrtoaddr via getPtrToAddrExpr. Mirror that in
getSCEVExprForVPValue. ptrtoint stays unmodelled, as createSCEV returns
an unknown for it.
Adds m_PtrToAddr to VPlanPatternMatch.
[mlir] Fix mlir-pdll-lsp-server link.
This is the same fix TableGenLspServerLib got in 9e469ced42cd.
This addresses the mlir-pdll-lsp-server instance of #152371.
MLIRPdllLspServerLib transitively needs LLVMTableGen, which is not part of
libLLVM.so, so MLIRPDLLParser already brings in static LLVMSupport. Linking the dylib here as well gives mlir-pdll-lsp-server two copies of LLVMSupport. Linking still succeeds, but with assertions view-output.test fails. The test trips over the two copies having different Hashing.h seeds, which is a separate defect to be addressed in another PR.
It has not shown up in CI because it needs the dylib and assertions at the same time, which rarely coincide. It also only became reachable once a3a25996b114 moved the LSP transport into libLLVM.so.
[CIR] Teach partial-array-destruction to work with arrays-of-records (#220045)
We currently assume that a partial-array destruction was a 1D array.
This is incorrect, as it can obviously be a MD array.
This patch comprehends the destruction across the array by using the
same begin/end iterators, but deleting these as element nodes.
Classic codegen does a full descent into the array types to do this
destruction, but I believe that is a side-effect of how it is going
through it. Treating arrays as contiguous and flattening the iterators
is effectively identical.
Note: Claude helped me extensively on the test, I believe all the
check-lines are correct, but I also pushed to make sure we got the full
structure checking correctly, so I hope this shows the differences above
properly.
[compiler-rt] Rename ubsan_device to ubsan_offload
The host interceptor and GPU handler library serve offload, not a
generic device sanitizer. Keep the Apple add_ubsan_device_testsuite name.
[BOLT] Parse .eh_frame CFI programs on demand to reduce memory
BOLT read the entire .eh_frame up front via DwCtx->getEHFrame(), which
parses and caches the CFI instruction program of every CIE/FDE in the
binary for the whole run. On a large binary, this dominated
file-object discovery: CFIProgram::parse accounted for ~6.5 GB and the
cached DWARFDebugFrame ~6.9 GB of live memory. Yet the CFI programs
are only consumed in CFIReaderWriter::fillCFIInfoFor, and only for the
functions BOLT actually disassembles. discoverFileObjects itself needs
nothing but each FDE's address and range for function-boundary checks.
Here we parse .eh_frame for its index only, and decode each function's
CFI program on demand, lazily, only for the functions that really need
it. In a large binary, DWARFDebugFrame::parse drops from 6922.2 MB
to 587.6 MB, the residual being the lightweight FDE/CIE index (entries
without instruction programs), and readSpecialSections falls from
7078.7 MB to 738.6 MB on the tested binary for which BOLT's RSS is
about 80-120GB.
[DebugInfo] Allow .eh_frame CFI programs to be parsed lazily (#214895)
BOLT read the entire .eh_frame up front via DwCtx->getEHFrame(), which
parses and caches the CFI instruction program of every CIE/FDE in the
binary for the whole run. On a large binary, this dominated file-object
discovery: CFIProgram::parse accounted for ~6.5 GB and the cached
DWARFDebugFrame ~6.9 GB of live memory (from 5 to 10% of total anon peak
RSS).
This new interface allows DebugInfo's users to optionally parse CFIs on
demand, only when necessary. On BOLT, this is an important lever to
manage memory utilization when processing large binaries. A real use
case is also implemented in llvm-dwarfdump: it now decodes CFIs lazily,
so if a user requests a dump of a specific entry, only that entry is
decoded. If another entry in that section is invalid, we don't error
anymore as that entry won't be decoded if the user did not request it.
NULL kernel pointers in nfs statfs(2) mount_info
nfs differs from other filesystems in that mount arguments can come from
both user and kernel space.
nfs_mount() sets args->fh to a kernel pointer. When root is on nfs,
nfs_boot_getfh() also sets addr and hostname to kernel pointers.
problem found and changes suggested by Andrew Griffiths
ok miod@ millert@ deraadt@
[BOLT] Fix data race on the shared .dwp DWARF context
As noted by labrinea, 775dc9b8bf58 ("[BOLT] Create and release .dwo
DWARF contexts incrementally") releases every DWO context at the end
of readDebugInfo, leaving the bucket threads of the DWARF rewrite to
re-open them on demand. With a .dwp package that moved the first touch
of a shared context into the parallel phase, and multiple threads
compete for it, in a race for the abbrev table, causing intermittent
failures in dwarf5-ftypes-dwp-input-dwo-output.test.
Open the split CUs of a package up front, from a single thread, and
resolve the abbreviation table of every unit in it. This is not
relevant for the non-dwp case, which is unaffected.
forgejo-runner: register missing dependencies
devel/git-base is necessary to clone the code of the actions, and
lang/nodejs is required to perform them.
nanobsd: Remove pandaboard.cfg
Pandaboard (sys/arm/ti/omap4) is removed due to lack of HW.
Remove the pandaboard config file for nanobsd aswell.
Approved by: imp, jlduran, manu(mentor)
Diffrential revision: https://reviews.freebsd.org/D54319