[Support] Pass tool options to parseCommandLineOptions
Add a `parseCommandLineOptions` overload that takes the libraries a tool
opts in to. Replace the global state `RegisterMCToolOptions` with
`mc::getToolOptions` and `codegen::getToolOptions`, which tools pass
where they parse, including lld's `-mllvm`, gold's `-plugin-opt`, and
libLTO's debug options.
`RegisterCodeGenFlags` no longer registers the MC options.
clang-linker-wrapper does not pass the MC options, so it now rejects
them in `-mllvm` and `--offload-opt`, which it forwards to the device
and host link steps. Its wrapper module uses the module's own context
instead of the user's `-mllvm`, as discussed on #233513.
`LibraryOptionsContext` records the library that parsed each argument,
so `assign`, which runs on each ThinLTO backend thread, replays without
looking up the registry.
LLM-aided
[mlir][SPIR-V] Add ComplexToSPIRV lowering for complex.exp and complex.expm1 (#239284)
Decompose both ops into their real/imaginary component formulas using
GLSL.std.450/OpenCL extended instructions, mirroring the existing
component-decomposition patterns in this file
[clang][bytecode] Optimize `CheckStore()` (#241345)
Block pointers are the only writable pointer type, which is why we're
checking for them very early in `CheckStore`. Make the distinction more
explicit and use the block and the `PtrView` of the pointer explicitly.
Set fletcher4 fastest uses_fpu from both byte orders
The "fastest" fletcher4 implementation is assembled from two
benchmark winners: the native functions come from the fastest native
implementation and the byteswap functions from the fastest byteswap
implementation. The two can differ. It still has a single uses_fpu
flag, which FLETCHER_4_FASTEST_FN_COPY() overwrites with each new
winner. The byteswap pass runs first, so the flag ends up as that of
the native winner.
When a SIMD implementation wins only the byteswap benchmark, as #14219
reports for the in-tree NEON code on a Yitian 710, byteswapped
fletcher4 then runs SIMD code without kfpu_begin() and kfpu_end().
That is reached by reading blocks written on a host of the other byte
order and by receiving such a send stream. On Linux this can corrupt
the FPU/SIMD register state of user tasks; FreeBSD requires
fpu_kern_enter() for kernel FPU use. This came in with 78289b8458,
which moved kfpu_begin()/kfpu_end() from each implementation's
init/fini, where the byte order was implied, into the callers.
[11 lines not shown]
libspl: remove the unused sys/asm_linkage.h
lib/libspl/include/sys/asm_linkage.h is a userspace copy of
include/sys/asm_linkage.h, but nothing includes it: config/Rules.am
puts include/ before lib/libspl/include, so <sys/asm_linkage.h> is
always include/sys/asm_linkage.h, which already covers userspace and
also defines ASMABI, which this copy lacks. Since 0b2819872 removed
the gate around its FRAME_BEGIN and FRAME_END but kept the #endif,
the copy does not even preprocess.
Remove it, and stop installing it as libspl/sys/asm_linkage.h.
include/sys/asm_linkage.h is installed with the libzfs headers, so
code built against the installed headers still finds a working one.
Reviewed-by: Brian Behlendorf <behlendorf1 at llnl.gov>
Reviewed-by: Rob Norris <rob.norris at truenas.com>
Signed-off-by: Tigerblue77 <37409593+tigerblue77 at users.noreply.github.com>
Closes #19555
PHIElim: Skip debug instructions when scanning for PHI source kills
readsRegister counts debug operands, so a DBG_VALUE of the PHI source
after the first inserted copy was treated as a read. Its slot index is
that of the next real instruction, so a lane kill was recorded there,
extending the lane past its last real read.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply at anthropic.com>
PHIElim: Trim PHI source subranges without a full shrinkToUses
This contains a repurposed version of #226209, plus a supplemental fix branch
which was never posted. #228073 was an alternative implementation which landed
first; this replaces the brute-force shrinkToUses with targeted live range
adjustments. Some crude stress test benchmarking suggests this is 2-4x faster
measuring the pass in isolation.
shrinkToUses rescans every use of each subrange which is much more than is
necessary. The only segments that need changing are only the ones ending at the
inserted phi source copies. Instead, track the per-lane copies as they are
inserted and trim each lane at its last read, clamped to the predecessor block,
and stop SplitCriticalEdge from extending subranges for lanes the PHI does not
read. This keeps the live ranges correct while avoiding the per-subrange
rescans. The shrinkToUses implementation's cost scales with the number of uses,
but this remains relatively flat. An example with 640 uses is 7.2x faster.
Because this edits segments surgically instead of recomputing them, it has to
get the bounds exactly right in cases shrinkToUses handles. The clamp to the
[13 lines not shown]
[ORC] Add opt-in per-JITDylib colocating slab allocator (#207970)
MapperJITLinkMemoryManager can now keep each JITDylib's objects within a
single reserved slab, so they stay within range of one another for
direct (e.g. x86-64 REL32, +/-2GB) references instead of needing
GOT/stub indirection.
Adds:
- ColocatePerJITDylib mode (per-JITDylib reservation pools).
- A growth policy (allowSingleSlab/allowMultipleSlabs/setOnSecondSlab)
consulted before reserving a second slab for a pool.
- CreateColocatingInProcess() and defaultSlabSize() (1 GiB on 64-bit, 10
MiB on 32-bit).
- LLJITBuilder::setColocatingSlabAllocator() to opt in.
This is opt-in only; the default memory manager is unchanged.
[38 lines not shown]
ZTS: fix send_raw_inherited_key's license boilerplate
The test added in f53b6403ea points at the old illumos.org CDDL URL,
so 'make checkstyle' fails in spdxcheck.
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 #19842
ZTS: test change-key key mismatch with a pool image
Since f53b6403ea, an incremental raw receive into a dataset that
inherits its key from a passphrase-keyed encryption root keeps the
local key. zfs_change-key_mismatch used that receive to make a dataset
whose key its encryption root can't unwrap, so the mismatch no longer
happens, 'zfs change-key' succeeds and the test fails every run.
Datasets damaged that way before that change still exist, and
change-key's error path for them (#17425) needs coverage. Add a small
pool image, made with a build from before that change, that already
holds such a dataset, and run the same checks against it.
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 #19842
[RISCV][P-ext] Make v2i32 insert_vector_elt with constant indices legal for RV32.
We can select to an insert_subreg.
The default lowering created a store+load to stack that got folded,
but left behind the stack slot allocation.
Assisted-by: Claude