[mlir][NFC] Remove includes of headers declaring used traits and interfaces (#240404)
The generated declarations of ops, attributes, types and interfaces now
include the headers declaring the core traits and interfaces they use.
Includes that headers only had for these generated declarations are
therefore redundant. This removes them in MLIR, Flang and ClangIR.
Includes of headers that the hand-written code uses directly are kept,
even when the generated code includes them as well.
Co-authored-by: Claude <noreply at anthropic.com>
[OpenMP] Use device scope for atomic constructs on the device
OpenMP 6.0, 17.8.5 specifies that "The memscope clause determines the
binding thread set for an atomic region. If the memscope clause is not
present, the behavior is as if the memscope clause appeared on the
construct with the device scope-specifier."
Thread the sync scopes through codegen amd also add a release note
because this is changing existing behavior.
Existing behavior was overly cautios for OpenMP 5.2, too, though. The
atomic construct never specified the option of having system-level
scope. This only came with the memscope clause and it's "all"
scope-specifier.
Claude assisted with this patch.
[MLIR][XeGPU] Limit transposed 2D block load height to 16 (#239469)
The hardware supports transposed 2D block loads with height 16 or 32,
but a 32-row tile does not align with the DPAS layout. Limit the
8/16/32-bit transposed block load entries in the uArch table to height
16.
Layout propagation now falls back to inst_data [16, 8] for a transposed
i32 load whose consumer asks for 32 rows, and the peephole optimizer
splits 32-row transposed loads into two 16-row loads.
Add a propagate-layout-inst-data test covering the fallback, and update
the peephole-optimize CHECK lines for the split loads.
assisted-by-claude
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
[OpenMP][clang] Apply atomic options to atomic compare
Thread denormal mode, fine-grained memory and remote memory options
through for atomic compare directivs.
Claude assisted with this patch.
[AMDGPU] Remove V_CNDMASK_B64_PSEUDO handling from SIFoldOperands. NFC. (#240324)
This is dead because the pseudo always gets expanded earlier, and broken
because it would have used V_MOV_B32 to move a 64-bit value.
netipsec: Do not leak the SAH when an SA is cloned
key_updateaddresses() gives the clone of an SA a new SAH reference when
the SA index comes from key_newsah() or key_getsah(), but nothing
releases the reference of the old SA: key_delsav() leaves the SAH alone,
because key_unlinksav() normally releases it, and an SA that is replaced
never goes through that. The SAH then stays allocated for good, after
its SAs are flushed and after the vnet is destroyed, as an SADB_UPDATE
with a new address does each time an IKE daemon moves an SA.
The old SA cannot release the reference when it is replaced, since a
sender that still holds it reads its SAH. Release it in key_delsav()
instead. When only the NAT-T config changes, the clone used to take over
the reference of the old SA; take a new one in that case as well, so that
every SA holds its own.
Reviewed by: kib, markj
MFC after: 1 week
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D61101
[libc] Apply scheduler attributes on thread creation (#225674)
POSIX specifies that pthread_create should apply the scheduling policy
and parameters given in the attributes object (if PTHREAD_EXPLICIT_SCHED
is set). Linux's clone syscall doesn't support setting scheduling
parameters directly, so we have to apply them from userspace via
sched_setscheduler after the thread is created.
To make sure the thread doesn't start running user code with the wrong
scheduling parameters (and to allow returning an error if
sched_setscheduler fails without leaving a half-running thread), I've
added a startup handshake using the clear_tid futex on the child stack:
- the child waits on the futex if explicit scheduling was requested
- the parent calls setschedparam, and then signals the child to either
continue (running) or abort (exit)
- if the call fails, the child exits immediately, the parent reaps it
via Thread::wait(), and returns the error code to the caller
Assisted-by: Gemini
[OpenMP][clang] Add ompx_fast_fp_atomics and ompx_safe_fp_atomics hints
Add omp_sync_hint_t extensions that override
-f[no-]atomic-ignore-denormal-mode (-m[no-]unsafe-fp-atomics) for a single
atomic construct. The safe hint takes precedence if both are given.
This is an upstreaming/copy-paste of downstream code and release notes.
Claude assisted with this patch.
[libc] Use CheckedPtr/make_unique in the regex code (#238366)
The regex code was written before we had unique_ptr, and so it did all
of its memory management by hand (AllocChecker + new/delete, with
scope_exit guards for the error paths). This replaces that with
make_unique, and stores the results in cpp::unique_ptr members.
Specific changes:
- ExprPool now holds its blocks, byte sets and hash table in
unique_ptr<T[]> members, which means the destructor can be defaulted.
Since unique_ptr does not know the size of the array, the capacity of
each array is now tracked in a separate field (previously it was implied
by the span size).
- make_unique<T[]> value-initializes the array, so the explicit
inline_memset of the hash table is gone.
- ParsedAtomStack and regcomp no longer need scope guards to clean up on
the error paths.
regfree still does a plain delete, as regex_t::__internal is a void
[18 lines not shown]
[InstCombine] Simplify `llvm.vector.shuffle` with constant or length 1 mask (#240231)
When a dynamic shuffle has a mask that can is const, it can lower to a
`shufflevector` instruction which is faster on some architectures (and
has real codegen lowering until
https://github.com/llvm/llvm-project/pull/240222 and friends all merge).
[flang][OpenMP] Add explicit triple to test (NFC) (#240298)
To avoid ABI differences across targets. This is irrelevant to the
purpose of the test.
Fixup for https://github.com/llvm/llvm-project/pull/227954 to fix a test
failure on s390x.
[lldb][NativePDB] Read the columns of line tables (#238603)
A CodeView line table has a column entry for every line entry when it
was emitted with columns (`DebugLinesHasColumns`, clang's
`-gcolumn-info`). `ParseLineTable` ignores them and gives every entry
column 0, so breakpoints by line and column can't resolve and stop
locations never show a column.
This patch takes the start column of each line entry from the column
entries when there are as many of them as line entries.
Fixes `TestBreakpointByLineAndColumn` (whose Makefile already passes
`-gcolumn-info`) with PDB debug info.
rdar://191741255
Hexagon: Fix HexagonOptAddrMode::processAddBases losing Changed (#240397)
processAddBases could rewrite one addi via updateAddBases and then
return false when a later addi in the list failed the usedInLoadStore
check. If nothing else changed, runOnMachineFunction then skipped
Liveness::resetKills, leaving stale kill flags. This was previously
hidden by the clearKillFlags call in updateAddBases removed in #239894,
and caused CodeGen/Hexagon/autohvx/addi-offset-opt-addr-mode.ll to fail
machine verification in EXPENSIVE_CHECKS builds.
Co-Authored-By: Claude Opus 5.5 <noreply at anthropic.com>
[AMDGPU] Warn about missing async barrier replay workarounds
Warn by default when assembly lacks the recognized EXEC-zero B8 replay
after an async barrier arrival. Keep recognition within a straight-line
assembly block and support targeted and general warning controls.
[CIR][AMDGPU] Look through address_space views when forwarding indirect args (#239158)
Summary:
- `CIRGen` loads AMDGPU locals through an `address_space` cast of their
addrspace(5) `alloca`.
- `forwardableIndirectLoad` required the load address to have the
parameter's type, so a `byref` argument was copied into a fresh slot
instead of passing the `alloca`.
- Now pass the `alloca` instead of copying into a new `byref` slot.
- `forwardableIndirectLoad` becomes `forwardableIndirectAddr` and
returns the cast's source when it has the parameter's type.
Relates to: https://github.com/llvm/llvm-project/issues/220471
Assisted by: claude opus 5.5
mvc:ApiControllerBase - increase server sent events limit to 15, browser seems to lock at 7, but in general we don't want to deplete our resource pool with streams (current max processes is 40).
[mlir][spirv] Fix invalid placeholder in FuncOpVectorUnroll (#240370)
FuncOpVectorUnroll uses an arith.constant from getZeroAttr as a
placeholder for each argument it does not unroll. Since #238629,
getZeroAttr returns null for types such as tensor<8x8xvector<4xi8>>,
so the pattern builds an arith.constant with no value. The greedy driver
erases the dead placeholder later, but expensive checks verify the IR
right after the pattern and fail:
error: 'arith.constant' op requires attribute 'value'
The placeholder's value is never read. Use a zero-operand
unrealized_conversion_cast instead, which works for any type.
func-signature-vector-unroll.mlir already covers this case.
Fixes https://lab.llvm.org/buildbot/#/builders/241/builds/1796