[SandboxVec][DAG][Scheduler] Move notifier logic from Scheduler to DAG (NFC) (#239097)
When an instruction gets created we need to update the state of the
scheduler and the DAG.
Up until now this was done with callbacks invoked by the Context. This
works, but there is some tight coupling between the update of the DAG
and scheduler states and it is not obvious what happens in which
sequence. To help fix this, the patch removes the scheduler callback and
keeps only the DAG callback. The DAG callback delegates the scheduler
maintenance to two Scheduler functions, one called in the beginning and
one at the end.
Add truenas-truesearch to Build-Depends and rename the service
The package build runs alembic. Alembic imports every plugin. The
truesearch plugin imports truesearch_client, and truenas-truesearch
installs that module.
The service base checks the model names of the public methods. Each
name must start with the name of the service class. The models are
named Truesearch, so the class is named TruesearchService.
[LoongArch] Fold zero comparisons into integer selects (#234841)
Use the original integer operand as the MASKEQZ/MASKNEZ condition for
selects comparing against zero, eliminating one redundant SLTU/SLTUI
instruction per select and matching GCC code generation.
Rework cnmagic(9):
- No more re-defining cn_trap(), cn_isconsole(), etc. Intead...
- Always provide cpu_Debugger() and console_debugger() in kern_stub.c.
- Move cnmagic(9)-related bits from <sys/systm.h> to <dev/cons.h>.
- Make ch_check_magic() return true/false based on "magic sequence
matched, action taken", eliminating the cn_trapped dance many
drivers did.
- Add a way to explicitly set the action using an API setter, rather
than having to define a CPP macro at the right time.
- Update callers to always pass their cnmagic state by reference rather
than by value (which was fine as a pure macro interface, not so much
when function calls are involved).
Bonvenon al NetBSD 11.99.11.
[RISCV][clang] Support XSfmm ABI attributes (#206260)
This patch introduces a new attribute keyword to describe the
architecture state for RISC-V, currently this is used by XSfmm matrix
state, detail usage is described in SiFive documentation:
https://www.sifive.com/document-file/xsfmm-matrix-extensions-specification
We add five new function type attributes:
1. __riscv_in("xsfmm"): function reads from matrix state
2. __riscv_out("xsfmm"): function writes to matrix state
3. __riscv_inout("xsfmm"): function reads and writes matrix state
4. __riscv_preserves("xsfmm"): function doesn't read or write state
5. __riscv_new("xsfmm"): function initiates new matrix state
TODO: Support __xsfmm_preserves statement attribute. We should allow non
user-defined functions that are xsfmm unaware and is proved to not
reading or writing the state, e.g. libc, libm, etc. One of the approach
is providing statement attribute, e.g. __xsfmm_preserves
printf("hello\n");, to make sema checking recognize and be aware of this
call.
[HIP] Add __exp2f to the HIP math header (#236328)
Add `__exp2f` to `__clang_hip_math.h`, next to `__expf` and `__exp10f`.
It lowers to `llvm.amdgcn.exp2`, which is a bare `v_exp_f32`.
`exp2f` goes through `llvm.exp2`. For f32, `AMDGPU` wraps `v_exp_f32` in
denormal handling unless f32 denormals are flushed. Kernels that know
their inputs stay above -126, such as the softmax in flash-attention,
only need the instruction. `__expf` and `__exp10f` already wrap the same
builtin, so this fills in the missing member of that family.
**CUDA does not define `__exp2f`, so this is a HIP-only extension.**
Assisted-by: Claude code
Signed-off-by: Keshav Vinayak Jha <keshavvinayakjha at gmail.com>
[LoongArch] Fix double rounding in vector uitofp to f32 (#239880)
Fixes #236744
Problem: `uitofp <N x i64> to <N x float>` is miscompiled with LASX. For
`0x8080808080808080` the result is `0x5f008080` instead of `0x5f008081`.
Approach: the generic half-word expansion converts the high and low
32-bit
halves separately and adds them, which rounds three times. LoongArch has
no
unsigned 64->32 conversion instruction, so lower the vector conversion
to the
same round-to-odd sequence the scalar legalizer uses. The select mask is
the
sign bit of the signed conversion: it is set exactly when the source did
not
fit, so an arithmetic shift of its bitcast broadcasts it to the f32
lanes and
[23 lines not shown]
[LoongArch] Fuse fptosi(frint(x)) into [x]vftintr{m,p,z,ne} (#239694)
Fixes #239067
`floor`/`ceil`/`trunc`/`roundeven` are exact in the floating-point
domain, so the
following round-toward-zero fp-to-int conversion performs no additional
rounding.
`fptosi(frint(x))` is therefore equivalent to a conversion using the
same rounding
mode and can be selected as a single `[x]vftintr{m,p,z,ne}`. The same
holds for
`fptosi.sat`: both forms saturate and map NaN to zero.
`fptoui(trunc(x))` folds
into `[x]vftintrz{.wu.s,.lu.d}` for the same reason.
Everything is selected by two TableGen multiclasses (LSX/LASX); no ISD
node, DAG
combine or legalizer change is involved. The four shapes reuse the
[34 lines not shown]
[libc++] Use section-based overridden function detection on Mach-O (#240482)
PR #208330 switched the non-ptrauth implementation of
__is_function_overridden to a mechanism that defines a local alias at
the same address as the weak function f.
Recent Mach-O linkers (e.g. the one in Xcode 27.0) bind references to a
weak definition directly when that definition has a local alias at the
same address, instead of going through a weak-def-coalesced stub or GOT
entry. Older linkers like the ones in Xcode 26.6 (which we use in the
CI) don't do that, which is why this wasn't caught by the CI. This means
that we always resolved `__is_function_overridden` to false with newer
linkers, which breaks the detection mechanism.
Assisted by Claude
Remove exFAT and FUSE filesystem tools from the ISO
These packages are now installed at first boot by setup-station, so
the ISO no longer needs to ship them (ghostbsd/issues#316).
[clang][Driver] Fix driver tests for in-process cc1 (#240520)
After #222531, multi-job `-###` driver invocations emit `(in-process)`
before each `-cc1` and `-cc1as` job when built with
`LLVM_TOOL_LLVM_DRIVER_BUILD=ON`.
Relax `*-NEXT` checks across consecutive cc1 jobs in the remaining
driver tests so they pass with and without in-process cc1.
Assisted by Gemini
[RISCV][P-ext] Regenerate scalar widening zip checks. NFC (#240255)
Regenerate the scalar widening zip checks added in #238758 with
`update_cc_test_checks.py`, preserving the script output for RV32 and
RV64.
[LoopSimplify] Only keep shared llvm.loop metadata on the merged latch (#238256)
When `insertUniqueBackedgeBlock` merges multiple backedges, it moves the
first non-null `!llvm.loop` it finds to the new latch, even if other
backedges have no metadata or different metadata. A loop property such
as `llvm.loop.mustprogress` that only held for one of the backedges then
applies to the whole loop.
Use `L->getLoopID()` instead, which returns the metadata only if all
latches share it.
Split out from #235627.
tools/git/ghpr: retire
The project under the .../ghpr subdirectory is an earlier version of the
tool. A newer/supported iteration of the tool can be found on
[GitHub][ghpr-repo].
`ghpr` can be installed via `pkg`, e.g., `pkg install py312-ghpr-5`.
Please see the [README.md][readme] for further details.
MFC after: 1 month
[ghpr-repo]: https://github.com/bsdimp/ghpr/
[readme]: https://github.com/bsdimp/ghpr/blob/main/README.md
Reviewed by: dteske
Differential Revision: https://reviews.freebsd.org/D61086
capsicum-test: Disable `HAVE_SEND_RECV_MMSG` again
04c4b2084eb9 accidentally added some changes from another WIP commit into that
diff. Instead of wholesale reverting the change, just revert the part that's
currently broken (`HAVE_SEND_RECV_MMSG`). While some of the related tests pass,
one of the testcases (`capmode.cc:AllowedMmsgSendRecv`) doesn't currently pass.
Revert the change to make the CI run more green again.
MFC after: 1 week
Fixes: 04c4b2084eb9 ("capsicum-test: make the code WARNS=6 clean")
SafeStack: Take libcall declarations from RuntimeLibcallsInfo
Stop declaring __stack_chk_fail and __safestack_pointer_address
manually and construct them with the correct type automatically.
A function with the variable's name is now reported as not being a
global variable, rather than a renamed copy of the variable being
inserted. -safestack-use-pointer-address now requires
__safestack_pointer_address to be available for the target, instead of
unconditionally emitting a call to it. The tests using it on
non-Android triples move to Android.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>