[LV] Allow targets to filter which types maximize bandwidth (#234642)
The motivation for this is to avoid maximizing bandwidth for `i1`s on
AArch64.
On AArch64, `i1` is a legal SVE predicate element type, but data vectors
require wider types.
Treating `i1` like any other element type in
`getSmallestAndWidestTypes()` can cause the maximize-vector-bandwidth
heuristic to select excessively large VFs based on the width of `i1`
vectors.
This is undesirable because predicate vectors are normally produced or
consumed alongside data vectors, and their legal width for such
operations matches that of the data vectors. Selecting wider predicate
vectors introduces unnecessary predicate unpacking and increases vector
register pressure.
[5 lines not shown]
[SPIRV] Select the correct `OpSelect` pseudo when dealing with untyped pointers (#240652)
We were not selecting the right flavour of `OpSelect` due to not
checking for `OpTypeUntypedPointerKHR` operands. This also exposed the
fact we were not always setting the correct register class. The patch
fixes both of these correlated issues.
[AMDGPU][AsmParser] Split the MTBUF formats into modifiers and regular operands
This eliminates the hacks parsing formats together with soffsets
that may follow them and printing them in printRegularOperand()
instead of using the custom printer as usual.
The legacy forms are supported as aliases using the
regular-operand formats.
Assisted-By: Claude
acpi_cpu: Bring back setting BM_RLD on resume
enable_idle(), which was called on resume before 427747fc16c9
("acpi_cpu: No longer disable idle during suspend"), also set BM_RLD.
This commit brings back just setting BM_RLD on resume because some
firmware might not be doing this itself on some machines.
Reviewed by: olce
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D61431
acpi_cpu: Bring back setting BM_RLD on resume
enable_idle(), which was called on resume before 427747fc16c9
("acpi_cpu: No longer disable idle during suspend"), also set BM_RLD.
This commit brings back just setting BM_RLD on resume because some
firmware might not be doing this itself on some machines.
Reviewed by: olce
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D61431
[OpenMP] Honour memory-order clauses on the flush directive
At present the acquire, release and acq_rel clauses on 'flush' are
accepted but have no effect. Flushes are emitted as __kmpc_flush runtime
calls, which implement a seq_cst fence.
AMD have had a downstream patch for a while (by Carlo Bertolli) which
adds per-ordering __kmpc_flush_* entry points to the device runtime.
This patch takes a slightly different approach: for the host, a seq_cst
flush still calls __kmpc_flush, and a flush with any other ordering
calls the __kmpc_flush_explicit entry point from #133325, so it needs
a runtime that has that. For the GPU, it emits a fence directly.
This has mild benefits: OpenMPOpt already handles fences when it converts
kernels to SPMD mode, but has no knowledge of the new __kmpc_flush calls
(either _explicit or Carlo's per-ordering flush calls). Scope names
differ per-GPU: they are determined using the mechanism introduced by
The lowering is done in OpenMPIRBuilder. The createFlush function now
[15 lines not shown]
[Clang][OpenMP] Add the OpenMP 6.0 memscope clause
This patch adds support for the 'memscope' clause from OpenMP 6.0 on
the 'flush' and 'atomic' directives. The clause selects the threads a
flush or atomic synchronizes with: those on the device (the default),
those in the contention group, or those on all devices. On 'flush',
a list may be specified alongside a memscope, but not together with a
memory-order clause (OpenMP 6.0, "17.8.6 flush Construct").
For the host, the scope is passed to the __kmpc_flush_explicit libomp
entry point as a __MEMORY_SCOPE_* value. For a GPU, the scope maps to a
target-specific syncscope for the fence.
Assisted-By: Claude
[CopyProf] Intercept new/delete and track per-object cost.
This intercepts the C++ `new` and `delete` operators, so that all
heap memory owned by a copy is tracked.
Using per-object state tracking, reports now tell the user how much
accumulated memory a copy is worth and whether it allocated.
This is useful for filtering of reports.
RFC: https://discourse.llvm.org/t/rfc-copysanitizer-csan-detecting-unneccessary-object-copies-at-runtime/91038
[CopyProf] Intercept C heap functions.
A copy that owns heap memory is only unnecessary if that memory is not
modified either. This intercepts the libc heap functions and routes them
to the CopyProf allocator, which marks memory allocated while copying as
copy, and checks the shadow memory of memory freed during destruction.
Memory allocated inside a d'tor is marked as copy as well, so that
freeing temporaries does not suppress reports.
Now that `malloc` is intercepted, `strndup` and `realpath` are
intercepted as well.
RFC: https://discourse.llvm.org/t/rfc-copysanitizer-csan-detecting-unneccessary-object-copies-at-runtime/91038
[CopyProf] Add standalone allocator. (#235453)
Detecting modifications of heap memory owned by a copy requires hooking
all (de)allocations and knowing allocation sizes. This adds a CopyProf
specific allocator based on the sanitizer_common allocator.
It provides surrogates for the libc heap functions, which are hooked up
to interceptors in a subsequent patch.
RFC:
https://discourse.llvm.org/t/rfc-copysanitizer-csan-detecting-unneccessary-object-copies-at-runtime/91038
Previous PR: #232851
Stack: #237763 → #232851 → #235453 (this PR) → #235454 → #235455
---------
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
[mlir][ODS] Include headers required by generated bytecode readers and writers
The generated bytecode readers and writers use `DialectBytecodeReader`,
`DialectBytecodeWriter` and `TypeSwitch` but did not include the headers
declaring them. They therefore relied on the surrounding source file to
include these headers first.
The generated readers and writers now include
`BytecodeImplementation.h` and `TypeSwitch.h`.
As these includes must not be expanded within a namespace, all users
now include the generated file at global scope rather than within their
anonymous namespace.
Similar to #236155 and #238735 but for the bytecode generator.
Co-authored-by: Claude <noreply at anthropic.com>
py-jsonschema: add py-rfc3987-syntax RDEP, this is in the "format-nongpl"
set of dependencies which are optional for jsonschema but needed by jupyter
ports.