BSD.tests.dist: Add entry for bsdconfig
Fixes: 9ffe2919e6b6 (bsdconfig: Resolve GEOM ids and names without scanning)
Sponsored by: The FreeBSD Foundation
[X86] Enable SlotIndexes compaction by default
Compacting SlotIndexes before greedy allocation drops the entries of
erased instructions, so live range sizes and instruction distances
reflect the code being allocated rather than how much was erased
before it. AMDGPU has done this since #235806; do the same for X86.
Codegen changes only through allocation: no new crashes, verifier
errors or allocation failures in the lit suites, including
EXPENSIVE_CHECKS, and a stage-2 build of LLVM, clang and lld with
-verify-machineinstrs passes its own tests. On llvm-test-suite at -O3,
spills drop 0.3% and .text 0.06%, with compile time unchanged.
Most test updates are regenerated checks. misched-matmul now inserts
20 spills instead of 24. live-debug-vars-stale-slotindexes.mir gets
one more use of %27 so that accumulate_fit still reaches the stale
index path it was written for. reloc-opt.ll gets an NF add that keeps
its source live, because compaction compresses the existing one to the
legacy form. inline-spiller-hoist-folded-copy.ll gets four empty asm
[2 lines not shown]
[X86] Clear _all_ register aliases in dynamic call RegMasks for preserve_most/all (#241595)
Previously, the code only removed _subregisters_ (inclusively) from the
register mask when removing registers for CCs like `preserve_most` or
`preserve_all`.
But when we do `MRI.disableCalleeSavedRegister`, it removes aliases
including superregisters and their aliases. Leaving the superregisters
marked as preserved can cause sibling subregisters to get clobbered
across `preserve_most` calls:
https://cpp.compiler-explorer.com/z/GjxerTYnz
The fix is to clear all subregisters of the root superregisters of the
disabled register.
Assisted-by: Antigravity with Gemini
ipfw_nat: Report a redirect that cannot be set up
nat44_config() ignores the error from add_redir_spool_cfg(), which
stops at the first redirect it cannot set up: one with an unknown mode,
a port redirect without ports or with a protocol other than TCP, UDP or
SCTP, or one for which libalias cannot allocate a link. That redirect
and the ones after it are dropped silently, but the instance keeps the
redirect count of the request, so "ipfw nat N show config" reports more
redirects than it returns and ipfw(8) misreads the reply ("unknown redir
mode"). A port range that runs out of memory partway also leaves its
first links in libalias.
Return the error, count only the redirects that are set up, and delete
the links of a port range that fails. As before, the instance stays
installed with the redirects ahead of the failed one. Add a
nat44_config test case for a redirect without ports.
Reviewed by: maxim
Fixes: d6164b77f8b7 ("Make ipfw_nat module use IP_FW3 codes.")
[3 lines not shown]
Float2Int: Replace -float2int-max-integer-bw cl::opt with pass parameter
Migrate the pass-specific command-line option to a new pass manager
pass parameter, exposed as float2int<max-integer-bw=N>.
Co-authored-by: Claude (Opus 4.8) <noreply at anthropic.com>
[MC] Only treat STT_SPARC_REGISTER as a register symbol for SPARC V9 (#248730)
STT_SPARC_REGISTER is STT_LOPROC, which other targets can use for their
own symbol type. Only give it the SPARC register symbol handling in
the ELF writer when the machine is EM_SPARCV9.
Reported by nvjle in
https://github.com/llvm/llvm-project/pull/246970#discussion_r4792717748
Assisted-by: Claude Opus 5.5
Thread SharedSampleProfile through PGOOptions and SampleProfileLoader.
Parallel pass pipelines such as rustc codegen workers need a way to pass a
pre-parsed `SharedSampleProfile` into `SampleProfileLoader` without reopening
the profile per module. Add an optional `SharedSampleProfile` field to
`PGOOptions` (asserting `Action == SampleUse` in `PGOOptions::resolve()`) and
forward it through `SampleProfileLoaderPass` to `SampleProfileReader::create`
and `takeSharedProfileSymbolList()`.
Use const ProfileSymbolList in SampleProfileLoader and SampleProfileMatcher.
Neither class mutates the symbol list. Making it const lets SampleProfileLoader
switch to SampleProfileReader::takeSharedProfileSymbolList(), which returns a
const pointer so a SharedSampleProfile can share it across parallel modules.
Support struct-style initialization for PGOOptions.
Constructing `PGOOptions` previously required 10 positional arguments with
empty placeholder strings, making new fields noisy to add. Add default member
initializers, a default constructor, and `PGOOptions::resolve()` (called by
`PassBuilder`), migrate callers, and remove the positional constructor.
Support context-sensitive ExtBinary profiles in SharedSampleProfile.
Context-sensitive ExtBinary profiles store callsite context frames in
`SecCSNameTable` and hash them lazily into `MD5SampleContextTable`, which
previously rejected sharing. Share immutable `SecCSNameTable` data through
`SampleProfileReaderBinary::CSNameTable`, populate the CS atomic MD5 vector
while guarding section ordering against `SecProfSummary`, and exercise
concurrent CS and non-CS readers under TSAN.
[lldb] Print the thread status in `thread select` (#248714)
Since c3faa1957735, `thread select` has not printed the new thread's
status itself. It broadcasts a thread-selected event, and the default
event handler prints the status when it receives it. `frame select`
prints its result directly.
The command result of `thread select` is therefore empty. A caller of
SBCommandInterpreter::HandleCommand can neither capture nor suppress
the status.
The event handler thread also prints while the next command runs. In a
breakpoint command, `thread select` followed by `bt` has both threads
format the same Objective-C argument, which sets up the language
runtime on first use, and LLDB can crash.
Print the status in the command, as `frame select` does, and stop
handling the event in the default event handler. Other clients still
receive it.
[6 lines not shown]
Add SharedSampleProfile for concurrent non-CS ExtBinary readers.
Compiling parallel codegen units against a large ExtBinary AutoFDO profile
previously forced each worker to decompress and index the entire profile
independently, multiplying memory usage linearly with worker count.
Add `SharedSampleProfile` to decompress sections and parse read-only non-CS
tables once, then borrow its backing buffer and shared tables across per-module
`SampleProfileReader` instances. Unsupported formats and context-sensitive
profiles return `sampleprof_error::unrecognized_format`, and readers preserve
`SkipFlatProf` filtering via per-section summaries and an aliasing
`std::shared_ptr<const ProfileSymbolList>`.
zpool_detach_spare_throttle: check that the pool reaches its dirty limit
Fail the test if dmu_tx_dirty_over_max hasn't increased by the time the
detach starts, so that a pass means the detach really ran while the pool
was at its dirty data limit.
Reviewed by: George Wilson <gwilson at zfsmail.com>
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Signed-off-by: Matthew Ahrens <matt at mahrens.org>
Co-Authored-By: Claude Opus 5.5 <noreply at anthropic.com>
Closes #19871
Don't wait for a tx under the config lock to log history
`zpool detach` of the original device of an in-use hot spare, and
`zpool split`, write history records while they hold the config lock
as writer. Both get a new tx for the record, and when the pool is at
its dirty data limit (or suspended), dmu_tx_assign() waits for a txg
sync, which can't start without the config lock, so the pool hangs.
Log these records with a tx assigned to the txg that the config change
goes into, as device removal does for its sync tasks. log_internal()
now writes the record itself only in syncing context; in open context
it always queues a sync task, including for an assigned tx.
dmu_tx_assign() now also asserts that a caller that might wait doesn't
hold any spa config lock as writer, which catches this kind of bug
without needing a full dirty data limit or a suspended pool.
Attach and detach now log the same way, before they drop the config
lock, instead of copying the device paths to log them afterwards, so
[7 lines not shown]
[mlir][Presburger] Expand PresburgerRelation::gist unit test coverage
Add tests exercising getValidConstraintsHull with shared and unshared
equalities, local variables (filtering and Simplex column padding),
symbolic variables, and mixed rationally-empty/non-empty context
disjuncts.
[mlir][Presburger] NFC: clarify PresburgerRelation::gist docstrings and comments
Document how the PresburgerRelation overload differs from the
IntegerRelation overload via the union-level isSubsetOf check, and note
that the hasOnlyDivLocals() check is a cost guard to avoid expensive
Fourier-Motzkin elimination during subtraction.
[mlir][Presburger] Deduplicate candidate constraints in getValidConstraintsHull
Normalize and deduplicate candidate constraints across disjuncts, skip
trivially valid constraints and empty context disjuncts, and avoid
re-checking a context disjunct's own constraints against its own Simplex.
[mlir][Presburger] Skip obviously empty context disjuncts in getValidConstraintsHull
Skip disjuncts where isObviouslyEmpty() holds (e.g., failing the equality
GCD test while remaining rationally feasible) before building a Simplex
so they do not needlessly weaken the hull.
[mlir][Presburger] Fix universe early returns in PresburgerRelation::gist
- Canonicalize isObviouslyUniverse() inputs to getUniverse(getSpace())
instead of returning *this with redundant extra disjuncts.
- Delegate context.isObviouslyUniverse() to gist(IntegerRelation::getUniverse)
so redundant constraints and empty disjuncts are simplified consistently
with the convex overload.
[mlir][Presburger] Add PresburgerRelation::gist
Add PresburgerRelation::gist (and PresburgerSet forwarding overloads)
for a convex context and for a context that is itself a union of
disjuncts, following ISL's isl_map_gist / isl_map_gist_basic_map.
For a convex context, each disjunct is simplified separately with
IntegerRelation::gist; disjuncts that become empty are dropped and if any
disjunct becomes the universe, the universe is returned.
For a non-convex context, the trivial cases (universe set or context,
empty context, equal set and context, context being a subset of the
set) are handled first. Otherwise, the context is approximated by a
convex set. Instead of ISL's unshifted simple hull of the context and the
set, we use the universe together with all constraints of the disjuncts
of the context and of the set that are valid for every disjunct of the
context (checked with Simplex); including the constraints of the set
allows removing constraints that are implied by every disjunct of the
context even if they are not implied by the simple hull.
[mlir][Presburger] Restore original division definitions in IntegerRelation::gist
In IntegerRelation::gistAligned, the division-restoration loop only
checked divs.hasRepr(i) after dropping context-implied constraints. If a
local variable lost its original floor-division defining inequalities
because the context implied them, but another remaining constraint (e.g.
an equality) still gave that local a *different* division representation,
the original defining bounds were not restored—changing the local's
meaning and breaking gist(rel, ctx) ∩ ctx == rel ∩ ctx.
Save the initial DivisionRepr alongside divDefs and require the restored
representation to match the original denominator and dividend. Add a
minimal regression test extracted from FuzzTest.
ZTS: test that removal gives back the gaps it copies
A removal copies the free gaps between nearby segments along with
them, in one allocation on another vdev. Freeing those gaps once the
copy is written keeps them from being allocated for TXG_DEFER_SIZE
txgs, so a fast removal can run that vdev out of space (#19442). On
master, a copy that cannot be allocated even at the smallest size trips
an ASSERT in spa_vdev_copy_impl() on a debug build, and can loop there,
holding its txg open, on a release one. So the test does not go that
far: it checks that the gaps never reach the destination's space maps.
With log space maps disabled, a metaslab's space map keeps the
allocations and frees of each txg, and zdb -mmmm prints them. A special
vdev takes all metadata, so the vdev added before the removal receives
nothing but the copies. One allocator and one 16K block per txg lay the
file out block after block on the vdev being removed. Overwriting every
other block then leaves a 16K gap after each block that stays, which
the default vdev_removal_max_span lets a copy span.
[10 lines not shown]
vdev removal: unallocate unused copy gaps immediately
A remap segment may span free gaps of up to vdev_removal_max_span, so
a removal copies those gaps too, in one allocation on the destination.
The gaps were then freed with zio_free(), which keeps them from being
allocated again for TXG_DEFER_SIZE txgs. A fast removal could run the
destination out of space (#19442). The gaps are allocated in the txg
of the copy, and the copy I/O is complete when they are released, so
unallocate them with metaslab_unalloc_dva() instead.
The copy I/O completes in open context, while the syncing txg may be
condensing the destination metaslab with ms_lock dropped, and
metaslab_unalloc_dva() VERIFYs that it is not. A gap is therefore
given back through metaslab_unalloc_range(), which leaves it
allocated and returns B_FALSE while the metaslab condenses; the gap is
then freed as before. metaslab_unalloc_range() also recomputes
ms_max_size, which metaslab_should_allocate() trusts for a loaded
metaslab: a full metaslab has it at 0, and the gaps given back to it
could otherwise not be allocated again before the txg syncs.
[7 lines not shown]
[lldb] Don't crash on ELF tables whose entry size is 0 (#248507)
ObjectFileELF counts the entries of a symbol or relocation table by
dividing the table's size by its sh_entsize, which it does not check.
When a corrupt ELF file's .symtab, .dynsym or .rela.plt has an
sh_entsize of 0, lldb divides by zero as it loads the file, which kills
it with SIGFPE on x86. A debug info relocation table in an object file
does the same when lldb reads the debug info.
Ignore a table whose entry size is 0, and log why. llvm-readelf refuses
to read such a table too. This includes the symbol table that names PLT
entries: with an entry size of 0, the PLT code would read symbol 0 for
every entry.
The new test crashes lldb without this change.
Assisted-by: Claude Code