[flang][OpenMP] Compare metadirective conditions by symbol identity (#233581)
When a METADIRECTIVE condition is false at runtime, the later candidates
that test the same condition are dropped. Conditions were compared with
evaluate::Expr equality, which treats dummy arguments of different
procedures at the same position as equal, so that procedure
characteristics can be compared. A condition on a host-associated dummy
argument and one on a local dummy argument were therefore the same, and
the second variant was never tried. For the same reason, `a .and. b` was
normalized to `a`.
This patch also requires the two conditions to reference the same
symbols in the same order.
Fixes #233562.
Assisted-by: GitHub Copilot (Claude Opus 5.5)
[lldb][test] Add requireMinidumpSave test decorator (#233775)
So we don't have to remember to add all the supported architectures to
new tests.
You can confirm the supported architectures for
saving specifically by looking at
ArchThreadContexts::prepareRegisterContext.
Only x86_64 and AArch64 are handled.
(I think we can read for other architectures,
but I haven't confirmed that)
TestMinidumpReloadCrash.py also checked for "arm64" and "arm64e". So
I've included those in the require as well. This might result in more
tests running
where they didn't before.
[libc++] Add a tool to find when a benchmark result changed (#233656)
Add `detect-changepoints`, which reads a time series line-by-line and
reports the changepoints in the time series.
The method is E-Divisive (Matteson & James, 2014), which has been used
for similar applications (e.g. MongoDB performance tooling similar to
what we're doing here, see [1]). Note that we're not using the
`signal-processing-algorithms` package [2] since that repo seems barely
maintained and does not support Python > 3.11.
[1]: https://dl.acm.org/doi/10.1145/3491204.3527488
[2]: https://github.com/mongodb/signal-processing-algorithms
Assisted by Claude
[lldb][docs] Use project-local documentation links (#228623)
Replace same-project absolute URLs with relative Markdown links and
Sphinx
cross-references so local and archived documentation stays
self-contained.
Update generated Python API docstrings at their header and SWIG inputs,
and repair stale Python and frame-recognizer destinations.
Validated by building LLDB docs with the new project self-link warning
in the upcoming PR.
Part of #214861
Assisted-by: Codex
[AArch64] Support FP atomic stores with memory hints
This patch extends the atomic-store-hint pseudos to accept preserved
floating-point atomic stores. It adds an FPR16 pseudo family and direct
half, bfloat, float, and double patterns for the supported addressing
modes.
The pseudos expand relaxed stores to STR and RCPC3 release and
sequentially consistent stores to STLUR, retaining memory hints without
cross-register-bank copies.
The existing AArch64::ATOMIC_STORE_HINT_H is renamed to
AArch64::ATOMIC_STORE_HINT_HH and AArch64::ATOMIC_STORE_HINT_H now means
FP16 instead of it's old association with integer half-word.
[AArch64] Support direct RCPC3 FP atomic loads and stores
Preserve half, bfloat, float, and double atomic loads and stores
through AtomicExpand for acquire and release orderings, and preserve
sequentially consistent stores, when RCPC3 and NEON are available.
Add SelectionDAG patterns for the RCPC3 LDAPUR and STLUR operations,
including unscaled offsets, and update the existing FP lane patterns to
match the preserved floating-point atomic nodes. Targets without the
required features continue to use integer lowering.
[AArch64] Support direct relaxed FP atomic loads and stores
This patch preserves half, bfloat, float, and double atomic loads and
stores through AtomicExpand when they use unordered or monotonic
ordering and the target supports floating point.
It adds SelectionDAG patterns that select the accesses directly in the
floating-point register bank. Unsupported targets, stronger orderings,
and stores carrying memory hints continue to use integer lowering.
[AMDGPU][True16] Fix tbuffer d16 store patterns in true16 mode (#232567)
In real true16 mode a 16-bit value lives in a `VGPR_16`, but the d16
format
buffer pseudos take (stores) or define (loads) a 32-bit data register.
Several
patterns matched the 16-bit value directly against the 32-bit operand
class, so
isel emitted bare `VGPR_16` <-> `VGPR_32` copies with no subregister
index.
Thread an `isTrue16` flag through the affected multiclasses:
- `MUBUF_StoreIntrinsicPat` / `MTBUF_StoreIntrinsicPat` use
`lo16_to_vgpr32` to
widen `$vdata` into the low half of a `VGPR_32`.
- `MTBUF_LoadIntrinsicPat` takes the low half of the 32-bit result with
`vgpr32_lo16`. Unlike `buffer_load_d16_format_x`, there is no `_t16`
pseudo
[8 lines not shown]
[AArch64] Avoid use-after-free in FrameLowering (#233864)
`RGI.getRegisters()` returns a temporary small vector, which is
destroyed after `reverse_conditionally` returns.
See #233826
[CIR][OpenMP] Add initial support for distribute
This patch adds initial support for the OpenMP 'distribute' directive. Basic
code generation for the standalone and combined cases is introduced. Support
for clauses will be added in the future. The composite 'teams distribute
parallel for' form will be added in a subsequent patch.
Assisted-by: Cursor / Claude Sonnet 5 High
[offload][OpenMP][NFC] Add a default-grid run to the no-loop tests
Add a run without OMP_NUM_TEAMS and OMP_TEAMS_THREAD_LIMIT to show the
kernels are promoted with the runtime's default grid as well.
[CIR] Admit only CIR types as nested CIR types
FuncType::verify required every type reachable from a signature to be a
CIR type, and proved it with a deep walk on every !cir.func construction.
#232863 memoized the walk in the dialect behind a mutex, but a record
that is still incomplete cannot be cached, and during CIRGen most of them
are.
The walk was needed because !cir.ptr, !cir.array, !cir.data_member,
!cir.bitfield and the record types took unconstrained mlir::Type
parameters. Constrain them to CIR types instead. Each type then checks
only its own parameters, a CIR type holds only CIR types at any depth,
and FuncType::verify checks only its inputs and result. The walk, the
cache and the mutex go away.
- Pointee, array element and data member types use a new
CIR_DialectType constraint.
- Bit-field storage, record members and union padding are checked in
their verifiers.
[12 lines not shown]
[CIR] Run record verifiers on get()
StructType and UnionType pulled in StorageUserBase's no-op
verifyInvariants template with `using Base::verifyInvariants`. get()
passes a unique_function as the diagnostic emitter, which matches the
template exactly, while the generated verifier takes a function_ref and
needs a conversion. Overload resolution picked the no-op, so record
verifiers only ran through getChecked(), i.e. in the parser.
The using-declaration was there so sub-element replacement could rebuild
an anonymous record with Base::get(ctx, key). Replace it with an overload
that takes the storage key and forwards to the generated verifier. In
builds with assertions, get() and replacement now verify records the same
way they verify every other CIR type.
Assisted-by: Claude Code (Claude Opus 5.5)
[AMDGPU][True16] Use vgpr32_lo16 for the scalar bf16 fpround result (#233659)
V_CVT_PK_BF16_F32_e64 defines a 32-bit register, so the single value
bf16 fpround pattern needs to take its low half in real true16 mode.
Split the pattern on True16Predicate and wrap the true16 form in
vgpr32_lo16.
Co-authored-by: Claude Opus 5 (1M context) <noreply at anthropic.com>
[flang][OpenMP] Improve diagnosing invalid operators in DECLARE_REDUCTION
Move the check out of the common MakeNameFromOperator function and
into OmpStructureChecker. Remove the no longer needed SemanticsContext
parameter in MakeNameFromOperator.
This will allow reusing at least some parts of the the name-mangling
code in DECLARE_INDUCTION.
[LifetimeSafety] Fix assertion failure inferring lifetimebound 'this' for deduced return types (#233558)
When the TU-wide inference decides a method's implicit object parameter
should be `[[clang::lifetimebound]]`, `addLifetimeBoundToImplicitThis`
wraps the method's function type in an AttributedType and rebuilds its
TypeLoc. It built the AttributedType from the method's (resolved) type
but copied the inner TypeLoc from the method's TypeSourceInfo.
For a method with a deduced 'auto' return type in a template
instantiation, the TypeSourceInfo still carries the written 'auto'
placeholder while the method's type has already been resolved to the
deduced type. The two disagree, so the wrapping AttributedTypeLoc's
inner type did not match the pushed inner TypeLoc, tripping a
TypeLocBuilder assertion (clang/lib/Sema/TypeLocBuilder.cpp):
```
Assertion failed: (TLast == LastTy && "mismatch between last type and new type's inner type")
```
[25 lines not shown]
[flang][OpenMP] Make sure that exec METADIRECTIVE is in execution part (#233147)
A METADIRECTIVE can be in either the specification part or the execution
part, depending on whether the variant directives contained in it are
declarative or executable. The OmpMetadirectiveDirective AST node can
hold any combination of variants, that is it can represent both kinds.
When the parser builds the specification part and attempts to create an
OmpMetadirectiveDirective, once it gets one it puts it in the
specification part regardless of the contents.
When an executable METADIRECTIVE is the first statement of the execution
part, it will end up in the specification part. This is an identical
situation as that for utility directives.
Recognize executable METADIRECTIVEs at the end of the specification part
and move them over to the beginning of the execution part.
[libc] Implement seteuid and setegid in unistd (#233088)
Implement the standard POSIX functions `seteuid` and `setegid` in
`<unistd.h>`.
Fixes #232380.
Assisted by Antigravity and reviewed by Aman Maurya.
RuntimeLibcalls: Use a single LibcallImpl for long double functions
Replace the per-format <func>l_{f80|f128|ppcf128} implementations with
a single <func>l implementaton. The concrete type is now derived from
the module/triple's LongDoubleFormat, so this is no longer a static
property.
On targets where long double is double, the l-suffixed functions do
not provide a libcall. This could be fixed in principle, but nothing
would use it in the compiler.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
[AArch64] Support direct RCPC3 FP atomic loads and stores
Preserve half, bfloat, float, and double atomic loads and stores
through AtomicExpand for acquire and release orderings, and preserve
sequentially consistent stores, when RCPC3 and NEON are available.
Add SelectionDAG patterns for the RCPC3 LDAPUR and STLUR operations,
including unscaled offsets, and update the existing FP lane patterns to
match the preserved floating-point atomic nodes. Targets without the
required features continue to use integer lowering.
[NFC] Change strided loop name
Changes strided loop to be named grid-stride loop instead for less
ambiguity as stride describes the jump distance in general.
feat(gisel): mirror trunc/xor/select demanded bits
Mirror SelectionDAG demand propagation, traversal, known-bits folding,
truncation of logical shifts, and XOR narrowing and simplifications.
Respect shared producers, legality and target profitability. Preserve
integer LLTs when narrowing and recognize known-constant shift amounts.
Share shift-amount validation, XOR/shift profitability, and target XOR
constant searches between selectors without an instruction variant.
Enable demanded-bits combining for RISC-V and preserve legal constant
types after legalization. Cover target immediates and shared-mask
bypasses with MIR and code-generation regressions.