[OpenMPOpt] Ask the runtime how many of a block's threads can be workers
The custom state machine gates a thread on InitCB < BlockHwSize - WarpSize,
reconstructing the number of worker threads from the block size on the
assumption that the main thread occupies a whole warp above them. The DeviceRTL
already computes that number, in mapping::getMaxTeamThreads(), and its own
generic state machine gates on it in shouldEnterStateMachine(). Export it as
__kmpc_get_max_team_threads() and call that instead, so the compiler's state
machine and the runtime's agree by construction rather than by arithmetic that
has to be kept in step with the launch geometry.
This is NFC here: getMaxTeamThreads() in generic mode is BlockSize - WarpSize,
the same three instructions folded into one call. It is not NFC for a toolchain
whose launch geometry differs. In ROCm, CGOpenMPRuntimeGPU starts a single extra
thread rather than a warp -- "Only one additional thread is started, not an
entire warp" -- so thread_limit(1024) on a 64-lane target launches 961 threads
and the runtime reports 960 workers, while the state machine's own arithmetic
says 961 - 64 = 897. The threads in between are in neither group: the state
machine returns immediately for them, and the parallel region still hands them
[12 lines not shown]
[OpenMPOpt] Look inside the callbacks the loop runtime functions are handed
The __kmpc_{distribute_,for_,distribute_for_}static_loop_* functions receive the
loop body as a callback, so a parallel region written inside that body is
reachable from the kernel through the runtime call. AAKernelInfo could not see
that, and recorded the call as reaching an unknown parallel region. A kernel
using these functions therefore always got a worker state machine whose only
option was to indirectly call whatever work function it was handed.
Describe the callback argument of each of these functions in OMPKinds.def and
attach the corresponding !callback metadata in OpenMPOpt, then fold the
callback's AAKernelInfo state into the caller's. The state machine can now
dispatch directly to the regions the loop body actually reaches. Relax the two
"more than one callee means give up" checks for functions carrying !callback,
since the callback edge is a second edge by construction and is analyzable.
The conservative unknown-region record is kept for the case that motivated it, a
callback we only see a declaration of.
[39 lines not shown]
contrib/kyua: fix -Wshadow error
This fixes the build with gcc 14:
/usr/src/contrib/kyua/engine/prepare/prepare_all.cpp:56:16: error: declaration of 'handler' shadows a member of 'engine::prepare::prepare_all' [-Werror=shadow]
56 | for (auto& handler : prepare::handlers()) {
| ^~~~~~~
In file included from /usr/src/contrib/kyua/engine/prepare/prepare_all.hpp:35,
from /usr/src/contrib/kyua/engine/prepare/prepare_all.cpp:29:
/usr/src/contrib/kyua/engine/prepare/prepare.hpp:51:15: note: shadowed declaration is here
51 | class handler {
| ^
Fixes: edb230c4af499203d7a6894b3711fe6574b26040
Reviewed by: igoro, rlibby, ngie
MFC after: 3 days
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D59346
tun.4: Canonicalize SYNOPSIS and AUTHORS
While here, s/PR#2411/NetBSD PR#2411/ in the comments for clarity.
I had to go to netbsd sources to get this information.
MFC after: 3 days
Event: Berlin Hackathon 202609
tws.4: Canonicalize SYNOPSIS + nits
+ wrap some long lines
+ escape some ? wildcards
+ no macros in width specifiers
+ mention the speed in HARDWARE (bumps date)
+ use the hyperlink macro for... the defunct LSI website...
+ write out a symbol heavy error message format string in mdoc
MFC after: 3 days
Event: Berlin Hackathon 202609
lualoader: Added a menu option for unmuting logs.
Added a dedicated menu option for toggling the `boot_menu` kenv variable
so that the user can easily toggle `boot_menu` off to see the kernel
messages.
Useful for debugging, etc.
Also moved the `core.recordDefaults()` out of the end of core.lua and put
it on top of menu.lua . When the function ran at the end of core.lua, it
did not capture the variables defined in loader configuration files.
This is a small bug in base.
Signed-off-by: b-aaz <b-aazbsd at proton.me>
psm(4): Disabled IMEX side-buttons by default.
This is a workaround.
At least two hypervisors (QEMU and VBox) are detected to be using this
mouse model by default and they send superfluous side button key events
when using the scroll wheel.
Added a runtime rw sysctl that disables the side buttons on this
specific model to workaround this issue.
Signed-off-by: b-aaz <b-aazbsd at proton.me>
lualoader: Added a menu option for unmuting logs.
Added a dedicated menu option for toggling the `boot_menu` kenv variable
so that the user can easily toggle `boot_menu` off to see the kernel
messages.
Useful for debugging, etc.
Also moved the `core.recordDefaults()` out of the end of core.lua and put
it on top of menu.lua . When the function ran at the end of core.lua, it
did not capture the variables defined in loader configuration files.
This is a small bug in base.
Signed-off-by: b-aaz <b-aazbsd at proton.me>
psm(4): Disabled IMEX side-buttons by default.
This is a workaround.
At least two hypervisors (QEMU and VBox) are detected to be using this
mouse model by default and they send superfluous side button key events
when using the scroll wheel.
Added a runtime rw sysctl that disables the side buttons on this
specific model to workaround this issue.
Signed-off-by: b-aaz <b-aazbsd at proton.me>
WebAssembly: Introduce ExceptionHandling::EmscriptenEH model
Add a dedicated EmscriptenEH exception model so the control uses
the standard exception model control, instead of relying on a backend
specific cl::opt. This will later migrate to a module flag and
remove -enable-emscripten-cxx-exceptions
Co-authored-by: Claude (Claude-Opus-4.8) <noreply at anthropic.com>
[LoongArch][RISCV] Ignore debug uses when merging base offsets (#221117)
## Summary
Debug instructions are currently enumerated as ordinary users by the RISC-V
and LoongArch merge-base-offset passes. A `DBG_VALUE` can therefore veto an
otherwise valid fold and make `-g` add an ordinary address-calculation
instruction.
Use the non-debug instruction iterator for validation and rewriting, and make
affected debug values unavailable before changing the address represented by
the destination register. Also handle the case where the register has no
ordinary users, which becomes possible after debug uses are excluded.
The same change is applied to both targets because their implementations and
failure mode are equivalent.
## Testing
[6 lines not shown]
DAGCombiner: Drop AllowFPOpFusion from visitFADDForFMACombine
Rewrites fp-dp3.ll to use flags on individual patterns. It weirdly
used different triples for the fp-contract on and off cases, seemingly
an artifact of the ARM64 and AArch64 merge.
fp-contract.cu is essentially a bugfix, the local fp contract(on) pragma
wins over the global flag now.
Co-authored-by: Claude (Claude-Opus-4.8) <noreply at anthropic.com>
[X86] LowerCLMUL - improve vXi32 codegen (#221289)
Shuffle combining is struggling to handle the mixture of vector
unrolling, truncations and optimal use of PCLMULQDQ swizzles, this patch
gives us more optimal lowering direct instead of relying on fixup.
Use the PCLMULQDQ lo/hi control immediate to handle anyext i64 element
evaluation - along with shifting the upper elements down to the lowest
bits of the i64 in parallel
Use UNPACK build vector pattern to avoid FPR<->GPR traffic
CLMULH needs to be handled in a future patch, and vXi16 /might/ be worth
handling as well.
sysutils/f3: Update 8.0 => 10.0, take maintainership
Upstream moved sources to src/, build output to build/, the man page to
man/ and the helper scripts to scripts/, adapt do-install accordingly.
While here, switch to DISTVERSION and pet portclippy.
Changelog:
https://github.com/AltraMayor/f3/blob/v10.0/changelog
PR: 298206
Approved by: osa, vvd (Mentors, implicit)
[Clang] Fix Crash in Sema::DiagnoseUnguardedAvailability On 'if' With No Condition (#220004)
**Problem**
C++ 23 introduced consteval expressions which allows `if` statements to
have no condition:
```
if consteval {
}
```
`DiagnoseUnguardedAvailability::TraverseIfStmt` Assumed `If->getCond()`
would never return a `nullptr`, causing a `nullptr` dereference.
Fixes #219948