[Offload][Omp] Split plugin diagnostics into detection & messaging
The plugin interface tracks a allocations and kernels (when TrackAllocationTraces
and TrackNumKernelLaunches are enabled) to emit diagnostic messages.
These messages currently contain OpenMP specific data that needs to be carried
through the Plugin Interface.
This PR splits this support in two pieces: tracking and detection that is
kept inside the plugins, and reporting of the error which is done through
a handler set from libomptarget.
A new diagnostic handler type is added, and the API to associate it to a device
are added to liboffload.
This will allow to handle the OpenMP specific data fromb the libomptarget handler
and remove it from the Plugin Interface (not done in this PR).
amdsmu(4): Fix 32-bit compile
For what is worth, since i386 is going away soon and still does not
compile.
Fixes: cd96657b6708 ("amdsmu: Print how long system spent in S0i3")
Sponsored by: The FreeBSD Foundation
sys/modules.h: Fix too long line
No functional change (intended).
Fixes: f4b3640475ce ("inline atomics and allow tied modules to inline locks")
Sponsored by: The FreeBSD Foundation
[wasm] Swift Async ABI p1: Pass the swiftasync argument in parameter 0 (#236131)
(see https://github.com/swiftlang/swift/pull/93554)
This commit attempts to start defining an ABI (WASM) for the async ctx
parameters to async functions. While other targets can rely on the name
of a register for this, in WASM the parameter position is what defines
its name, so an ABI must be position dependent.
The proposal here is to always place the async context in the first
parameter for WASM. (The swifttailcc padding for a missing swiftasync
argument also becomes parameter 0).
The WebAssembly parameter list already differs from the IR parameter
list:
* The backend already synthesizes parameters that are not in the IR
list:
the demoted sret pointer, the varargs buffer pointer, and the swiftself,
swifterror and swiftasync padding.
* Direct precedent: LowerCall already reorders arguments for an ABI. For
[10 lines not shown]
[Offload][Omp] Split plugin diagnostics into detection & messaging
The plugin interface tracks a allocations and kernels (when TrackAllocationTraces
and TrackNumKernelLaunches are enabled) to emit diagnostic messages.
These messages currently contain OpenMP specific data that needs to be carried
through the Plugin Interface.
This PR splits this support in two pieces: tracking and detection that is
kept inside the plugins, and reporting of the error which is done through
a handler set from libomptarget.
A new diagnostic handler type is added, and the API to associate it to a device
are added to liboffload.
This will allow to handle the OpenMP specific data fromb the libomptarget handler
and remove it from the Plugin Interface (not done in this PR).
[mlir][test] Link MLIRBufferizationTestPasses to MLIRTestDialect directly (#238752)
#236155 removed the explicit test dialect include directories from
MLIRBufferizationTestPasses, relying on the usage requirements of
MLIRTestDialect instead. The library linked MLIRTestDialect via
`mlir_target_link_libraries`, which links libMLIR instead of the given
libraries if `MLIR_LINK_MLIR_DYLIB` is enabled. Since the test dialect
is not part of libMLIR, it was never linked, and its include directories
were never added, causing `TestDialect.h` to not be found.
Link MLIRTestDialect via `LINK_LIBS` like all other test libraries.
[CIR] Run SimplifyConstantLoad in the same driver as the other patterns
CIRSimplify ran SimplifyConstantLoad in a second greedy driver because the
pattern cached a DominanceInfo that the ternary and switch rewrites could
leave stale. Keeping the phases apart needed a second op list, pruned of
the loads the first phase erased, and it left simplifications behind: a
load inside a ternary branch only folds in the second phase, after the
ternary pattern has already rejected that branch as non-trivial.
Share one DominanceInfo between the pass and the pattern and keep it
coherent with a listener that drops a region's cached tree when its
blocks change or the region is erased. All patterns then run in one
driver over one worklist, and the driver itself handles erased loads.
Pass time is unchanged on real inputs and on an 8000-block stress
function (13 ms before and after). Computing dominance per match
instead would take 2.5 s there.
Assisted-by: Claude Code (claude-fable-5-1).
[mlir] remove dead values: don't remove used symbols
This was hitherto accidental for functions and region-carrying globals, make it
intentional. In a custom dialect, one may have a side effect free global-like
operation with a symbol referenced from elsewhere in the translation unit. We
don't want that to be removed.
Assisted-by: Gemini 4 Argon
[libc++abi] Split strcmp and non-strcmp dynamic_casts (#230762)
The `strcmp` path is only selected for at the top of the call chain, but
causes significant amounts of overhead, since all functions have to
check for it whenever they compare for equality. Furthermore, the strcmp
case is almost never used, since there has to be a user error detected
for it to kick in, and on most platforms that branch is completely
disabled. By instead having separate virtual functions for the two cases
the performance can be significantly improved. This also removes the
code entirely if `_LIBCXXABI_FORGIVING_DYNAMIC_CAST` is not enabled.
[libc] Treat reallocarray as an external allocator entrypoint (#236918)
This patch adds `reallocarray` to LLVM libc under `stdlib` as
standardized in POSIX.1-2024.
Following maintainer discussion, `reallocarray` is treated as an
external allocator entrypoint (similar to `malloc` and `realloc`),
backed by the underlying allocator (e.g. Scudo):
- Adds `reallocarray` declaration to `libc/include/stdlib-malloc.yaml`
under the POSIX standard.
- Adds `reallocarray` to `libc/utils/docgen/stdlib.yaml` tracking
POSIX.1-2024.
- Declares the external entrypoint in `libc/src/stdlib/CMakeLists.txt`
and `libc/src/stdlib/reallocarray.h`.
- Adds `reallocarray` to external entrypoints across Linux targets
(`x86_64`, `aarch64`, `riscv`).
Fixes #236898.
[mlir][test] Link MLIRBufferizationTestPasses to MLIRTestDialect directly
#236155 removed the explicit test dialect include directories from
MLIRBufferizationTestPasses, relying on the usage requirements of
MLIRTestDialect instead. The library linked MLIRTestDialect via
`mlir_target_link_libraries`, which links libMLIR instead of the given
libraries if `MLIR_LINK_MLIR_DYLIB` is enabled. Since the test dialect
is not part of libMLIR, it was never linked, and its include directories
were never added, causing `TestDialect.h` to not be found.
Link MLIRTestDialect via `LINK_LIBS` like all other test libraries.