[AtomicExpand][NVPTX] Add single-lane atomic RMW coverage
Record current expansion and code generation before changing single-lane RMW legalization. Check the full pipeline separately from direct instruction selection while their output differs.
[clang][Driver] Fix libc++ include path on OpenBSD (#212979)
`clang++` defaults to `-stdlib=libc++` on OpenBSD. When building with both
`clang` and `libcxx` included, the freshly built `clang++` uses the system
version of the `libc++` headers. However, this is from the bundled `libc++`
22.1.8, thus inconsistent with the `libc++` being built.
OpenBSD has its own version of addLibCxxIncludePaths which just includes
`/usr/include/c++/v1`.
This patch removes OpenBSD::addLibCxxIncludePaths in favour of the generic
version in `Gnu.cpp`.
[X86] Combine mask_beforefirst to (x - 1) & ~x in GPR
EVEX and libc use this pattern in strcpy etc. to set the bits before the lowest set bit. It works correctly for x=0 too, returning an all ones mask.
Because SSE/AVX/AVX2 promote vNi1 types, do this as a DAG combine before type legalization.
We need to restrict it to power of 2 types otherwise we hit a latent crash in combineToExtendBoolVectorInReg.
[VPlan] Use llvm.mask.beforefirst for computing early exit mask
This makes the cost more accurate and improves codegen for RISC-V. The codegen for an early exit loop with side effects then goes from:
.LBB0_3: # %vector.body
# =>This Inner Loop Header: Depth=1
vl1r.v v16, (a3)
vsetvli zero, zero, e8, m1, ta, ma
vmseq.vi v16, v16, 0
vfirst.m a7, v16
srli t0, a7, 63
czero.nez a7, a7, t0
czero.eqz t0, a1, t0
or a7, t0, a7
vsetvli zero, zero, e64, m8, ta, ma
vmsltu.vx v0, v8, a7
vle8.v v17, (a5), v0.t
vcpop.m t1, v16
vsetvli zero, zero, e8, m1, ta, ma
[20 lines not shown]
[ConstantFolding] Add constant folding for mask.beforefirst
Poison lanes poison the entire result, and undef elements are ignored
Assisted-by: Opus 5.5
ipfw: hold sleepable "upper half lock" for periodic state expiry
The state expiration may lead to freeing rules, which requires this lock.
Since the lock is sleepable, move the expiry routine from callout context
to a taskqueue. This also should have a positive effect of not running
expensive function as a callout.
Fixes: e3caa360d5d0a73af0de1d293d5b8ff6e900ceb4
Reviewed by: pouria
Differential Revision: https://reviews.freebsd.org/D60869
tcp: refactor tcp_autosndbuf() and associated sysctls
Rename tcp_sndbuf_autoscale() to tcp_autosndbuf(). This matches
complementary tcp_autorcvbuf() that was factored out as a separate
function a few months before tcp_sndbuf_autoscale() was. Move the large
comment to the header of the function. Use unsigned types for all sizing
sysctls and variables and use bool for the switching sysctl. Add a
comment above net.inet.tcp.sendbuf_auto_lowat (default to off) providing a
reference to its origins. Add DTrace probe tcp::send-autoresize,
complementary to the existing tcp::receive-autoresize.
Rack has its own function, just enable the DTrace probe there.
Reviewed by: tuexen
Differential Revision: https://reviews.freebsd.org/D60732
tcp: refactor tcp_autorcvbuf() and associated sysctls
Run the entire function under the socket buffer lock. Make it responsible
to set the new limit or clear SB_AUTOSIZE in case of a failure. Use
unsigned type for newsize, that matches both the sb_hiwat type and min()
argument types. Make byte counter in the tcpcb unsigned, too. Make the
sizing tunables unsigned, and make the switching tunable a boolean. Don't
execute Dtrace probe in case of a failure. Simplify the Dtrace probe to
report only relevant information, the previous probe looked more like a
leftover from a debugging session.
Reviewed by: tuexen
Differential Revision: https://reviews.freebsd.org/D60731
[ThinLTO] Create IR declarations for functions imported as declarations (#233959)
Previously, function and function-alias summaries marked with the
`Declaration` import type (e.g. via `-import-declaration`) were emitted
into the summary index for analysis/attribute propagation, but
`FunctionImporter::importFunctions` did not materialize corresponding IR
declarations in the destination module.
Update `FunctionImporter::importFunctions` to create `ExternalLinkage`
function declarations in the importing module for functions and function
aliases whose import type is `Declaration` (when not already present in
the destination module). Copy the source function's calling convention,
attributes, and visibility, and attach `!guid` metadata with the
pre-promotion GUID so that the declaration can be located by GUID in the
backend (e.g. via the module symbol table during indirect call
promotion).
This will be used by a follow-up MemProf ThinLTO change to import
declarations of cross-module indirect call targets assigned to cloned
[7 lines not shown]
[MSP430] Declare command line options in TableGen (#234455)
Move the cl::opts into MSP430Options.td. MSP430TargetMachine holds
`const MSP430Options &CLOpts`, and MSP430Subtarget and
MSP430TargetLowering copy it.
MSP430Subtarget::HWMultEnum becomes `enum class MSP430::HWMult`.
-mhwmult is renamed to -msp430-hwmult, with the old spelling kept as an
alias.
LLM-aided
[DirectX][SPIRV] Add ImmArg to constant intrinsics arguments (#232470)
Adds `ImmArg` annotations to intrinsic arguments that should always be
constant.
For DirectX this applies to:
- `dx_thread_id`, `dx_group_id`, `dx_thread_id_in_group` - the index
argument
- `int_dx_resource_atomic_binop` - the binary op code argument
- `dx_resource_updatecounter` - the increment/decrement value argument
- `dx_resource_gather`, `dx_resource_gather_cmp` - the component
argument
- `dx_barrier_by_memory_type`, `int_dx_barrier_by_memory_handle` - flags
arguments
- `dx_load_input`, `dx_store_input` - signature element ID and row/col
indices
For SPIRV this applies to:
- `spv_resource_updatecounter` - the increment/decrement value argument
[9 lines not shown]