[lldb] Avoid stack unwinding in LLDB CommandInterpreter dispatch (#248922)
Avoid stack unwinding in LLDB CommandInterpreter telemetry dispatch.
`CommandInterpreter::HandleCommand` previously called
`GetExecutionContext().GetTargetPtr()` in telemetry dispatch just to
read the target executable UUID. `GetExecutionContext()` selects the
current thread and frame (`Thread::GetSelectedFrame()`), which can
trigger stack unwinding (`UnwindLLDB`) and lazy `LanguageRuntime`
initialization. When a background listener thread calls
`SBDebugger::HandleCommand` during `process attach`, this can deadlock
with the attach thread on `Process::m_language_runtimes_mutex` and
`Target::m_images.m_modules_mutex`.
Read `TargetSP` directly from `m_overriden_exe_contexts.top()` or
`GetSelectedTarget()` instead, preserving `target_uuid` without
constructing a full `ExecutionContext`.
Split of https://github.com/llvm/llvm-project/pull/248850
Assisted-by: Gemini
[AArch64] Add comprehensive test for interleave intrinsic (NFC) (#248116)
This add comprehensive tests for all (de)interleave factors with
differing fixed vector sizes and element types.
It tests with NEON and Fixed SVE codegen.
Reland "[mlir][SPIR-V] Add SPIRVToLLVM conversion for INTEL function pointer ops" (#247577) (#248035)
Reverted in #248011 because the pattern list grew to 258 types, above
the 256 fold expression limit of clang 20 and older
Fixed by #248020, which splits the list
[libc] Restore original baremetal Armv7-M build job and move the newer one into a new job (#246341)
Commit 45c1ca821806398715f6bddf716bc415ca969c0 added run support to the
baremetal Armv7-M CMake cache file. However by doing so it changed some
libc configuration options that were useful to build the library with.
This patch restores the original CMake cache file, creates a new cache
file specific for building and running applications and tests, and
finally creates a new premerge job to run with the new cache file.
[AArch64] Add macro and clang flag for lse2 (#243436)
FEAT_LSE2 is important as it affects atomics CodeGen for 128-bit types.
Until now it didn't have march
flag or macro and the only way to use was to specify armv8.4 arch
onwards. That is not great as the feature is available from 8.2 .
The macro is added based on the [ACLE
proposal.](https://github.com/ARM-software/acle/pull/478)
[libc] Add premerge CI job for baremetal AArch64 A-profile hard FP (#248083)
This patch adds a CMake cache file to configure the build and test of
baremetal AArch64 A-profile hard FP. The settings are taken from Arm
Toolchain for Embedded.
Plus it also adds a new premerge CI job for it.
[AArch64] Implement InstCombine for sve_and_u and sve_eor_u
Canonicalize the following same-predicate expressions:
sve_and_u(p, a, sve_eor_m/z(p, a, c))
sve_eor_u(p, a, sve_and_m/z(p, a, c))
sve_and_u(p, a, sve_not(p, passthru, c))
to:
sve_and_u(p, a, sve_eor_u(p, c, splat(-1)))
The inner operation must have one use. This keeps the transform
instruction-count neutral and allows SelectionDAG to lower the
undef forms to generic AND and XOR nodes.
[Mips] Don't turn off MIPS III and later with -fp64 (#248776)
MIPS III and MIPS32r6 implied FeatureFP64Bit. Turning off a feature
also turns off the features that imply it, so -fp64, which Clang passes
for -mfp32, turned a MIPS III, MIPS IV or MIPS64 subtarget into MIPS II
or MIPS32, and .module fp=32 did the same in the assembler. The code
was then built for, and marked as, the older ISA.
Don't imply FeatureFP64Bit from the ISA features, and turn it on by
default for MIPS III and later and MIPS32r6 unless +fp64 or -fp64 is
given. .set mips3 and later still select 64-bit FPRs, like GNU as.
MIPS32r6 and MIPS64r6 with -fp64 is now an error rather than an
assertion failure.
Assisted-by: Claude Opus 5.5
[Mips] Use __truncdfhf2 for f64 -> f16 with MSA instead of double rounding (#244991)
MipsSETargetLowering::lowerFP_TO_FP16 converted an f64 source to f16 by
narrowing to f32 with fexdo.w and then to f16 with fexdo.h. The
intermediate rounding to f32 loses the sticky bits, so a value just
above a half-precision rounding midpoint lands on the midpoint and
then rounds to even, giving the wrong result.
Only mark FP_TO_FP16 Custom for f32 sources, and let f64 sources use
the default expansion, the __truncdfhf2 libcall, as is done without
MSA.
Fixes #244167.
Assisted-by: Claude Opus 5.5
[SystemZ] [GOFF] Support additional relocation types and associated specifiers (#248198)
This is to support additional relocation types and associated
specifiers, including GOFF::RLD_RT_RLength,
GOFF::RLD_RT_RRelativeImmediate, and GOFF::RLD_RT_RLongDisplacement.
[CIR] Handle integers wider than 64 bits in the vector constant folders
`cir::IntAttr::getUInt()` and `getSInt()` assert when the value needs
more than 64 bits. The folders of `cir.vec.cmp`, `cir.vec.ternary` and
`cir.vec.shuffle.dynamic` read constant elements through them, so they
asserted on a vector of `__int128` with such an element. C++ reaches
all three at -O0. The verifier of `cir.vec.shuffle` read its indices the
same way and asserted while parsing an index wider than 64 bits.
They now work on the `APInt` values:
- `cir.vec.cmp` compares the elements at their full width.
- `cir.vec.ternary` tests whether the condition element is zero.
- `cir.vec.shuffle.dynamic` masks the index before narrowing it.
- The `cir.vec.shuffle` verifier recognizes the -1 index by all of its
bits being set and range-checks the other indices without narrowing
them.
Folds of integers up to 64 bits are unchanged.
[2 lines not shown]
[clang] Properly adjust lambda decl context in predefined expressions (#246670)
Resolves #221564
The problem was introduced in #211811. It mistakenly assumes that when
the `DeclContext` of a lambda call operator is encountered, a
corresponding `LambdaScopeInfo` is present on the `Sema.FunctionScopes`
stack.
This assumption holds only during the definition of a lambda, and not if
the call operator is explicitly referenced after the lambda is defined:
```cpp
auto l = []() { return __func__; }; //this is fine
using L = decltype(l);
constexpr auto L::operator()() const { return __func__; } //no LambdaScopeInfo here
```
To fix this, the `DeclContext` in `getPredefinedExprDecl` is adjusted
only if it matches with the call operator of a `LambdaScopeInfo`
currently on the stack.
[ConstraintElim] Check for overflow when adding left-hand side coefficients (#246388)
`getRowForLessEqual` checked the right-hand side coefficients for
overflow but added the left-hand side ones with a plain `+=`, so a
variable that appears several times on the left could wrap and the
compare got folded wrongly. This uses `AddOverflow` and gives up on
overflow, like the right-hand side. On the issue's IR, `opt
-passes=constraint-elimination` folded the compare to `true` before and
leaves it alone now.
Fixes #245363
Assisted-by: Grok Bot (AI coding agent)
[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.
[OpenMP][clang] Apply atomic options to atomic compare (#240421)
Thread denormal mode, fine-grained memory and remote memory options
through for atomic compare directivs.
Claude assisted with this patch.
[CodeGen] Added '*' to internal linkage types (#220864)
RTTI typename for internal-linkage types lacked '*', which broke
type_info::operator== and dynamic_cast with libstdc++
Fixes #34255
Fixes #79367
Fixes #59790
AI usage: Claude (reviewed test files)
---------
Co-authored-by: Jones, Matthew (DI SW SIM FRWK PLAT SIMFW HPC) <jones.matthew at siemens.com>
Co-authored-by: Nikolas Klauser <nikolasklauser at berlin.de>
Co-authored-by: Tom <tajames at zoho.com>
[AMDGPU] Defer VOPD lookup in `checkVOPDRegConstraints` (NFC) (#248899)
The table lookup is relatively expensive so allow cheaper checks to run
first. The change improves compile-time by 1-2% on the motivating
compute shader.
Assisted-by: Claude Opus 5.5
[CIR] Fix crashes in the complex constant folders
The folders of `cir.complex.real`, `cir.complex.imag` and
`cir.complex.create` asserted on constants that the `cir.const` verifier
accepts.
`cir.complex.real` and `cir.complex.imag` cast a constant operand to
`#cir.const_complex`. A complex constant can also be `#cir.zero`,
`#cir.undef` or `#cir.poison`. CIRGen emits `#cir.zero` for a
value-initialized complex, so clang crashed on `__real__ CI()`. A part
of `#cir.zero` now folds to the zero of the element type. A part of
`#cir.undef` or `#cir.poison` folds to undef or poison, as the cast
folder does for its operand.
`cir.complex.create` built a `#cir.const_complex` from any two constant
parts. The attribute holds int or float literals only, so its verifier
failed on a part that is undef, poison or a global view. The folder now
leaves such a create alone.
Assisted-by: Claude Code (Fable 5.2).
[lldb][PDB] Remove the DIA symbol file plugin (#247254)
I think it's time now. This PR removes `SymbolFilePDB` and associated
files. To my knowledge, there have been no major issues in the native
plugin that break the debugging experience.
This completes the RFC:
https://discourse.llvm.org/t/rfc-removing-the-dia-pdb-plugin-from-lldb/87827.
We initially set out to remove the plugin in 23, but didn't due to 22
still requiring a specific version of Python ([this
comment](https://discourse.llvm.org/t/rfc-removing-the-dia-pdb-plugin-from-lldb/87827/28)).
Quick refresher on why we're preferring the native plugin over DIA:
- DIA is only available on Windows, making remote debugging not possible
and for testing lldb itself, we can't run DIA tests that don't run the
target on Linux.
- DIA is a black-box. We don't know its implementation, so there is a
gap when debugging issues with it. Whereas the native plugin is fully
implemented in LLVM itself. This also means we LLVM/Clang and lldb
[6 lines not shown]