PPC: Add MIR examples for missed extsw+word-load fold on subregister input
A gprc LWZ/LWZX feeding EXTSW_32_64 folds into a sign-extending LWA/LWAX
load. The equivalent 64-bit zero-extending word loads (LWZ8/LWZX8) whose
sub_32 feeds EXTSW_32_64 are not folded, leaving a redundant lwz+extsw
(or lwzx+extsw) pair. Add MIR examples documenting the missed fold.
Co-authored-by: Claude (Claude Opus 4.8, claude-opus-4-8) <noreply at anthropic.com>
PPC: Fold 64-bit zero-extending word load feeding extsw subregister
A gprc LWZ/LWZX feeding EXTSW_32_64 is rewritten into a sign-extending
LWA/LWAX load. Extend the same fold to the 64-bit zero-extending word
loads LWZ8/LWZX8 when the EXTSW_32_64 reads their sub_32 subregister,
producing a single LWA/LWAX instead of a redundant lwz+extsw pair.
Co-authored-by: Claude (Claude Opus 4.8, claude-opus-4-8) <noreply at anthropic.com>
PPC: Fix extsw elimination when the input reads a subregister
The EXTSW_32_64 sign-extend elimination previously assumed its input
was a full register value. It would then try using that value as the
source of the new (unnecessary) INSERT_SUBREG.
The new test would then hit this verifier error:
```
bb.0:
liveins: $x3
%0:g8rc = COPY killed $x3
%1:g8rc = RLDICL killed %0:g8rc, 0, 33
%3:g8rc = IMPLICIT_DEF
%2:g8rc = INSERT_SUBREG %3:g8rc(tied-def 0), %1:g8rc, %subreg.sub_32
$x3 = COPY killed %2:g8rc
BLR8 implicit $lr8, implicit $rm, implicit killed $x3
*** Bad machine code: INSERT_SUBREG expected inserted value to have equal or lesser size than the subreg it was inserted into ***
[8 lines not shown]
[clang] Implement C2y stdc_load8_* endian-aware 8-bit load functions (#203666)
Implement all 32 stdc_load8_* functions from C2y:
stdc_load8_le{u,s}{8,16,32,64}
stdc_load8_be{u,s}{8,16,32,64}
stdc_load8_aligned_le{u,s}{8,16,32,64}
stdc_load8_aligned_be{u,s}{8,16,32,64}
These functions read N bytes from a const unsigned char* and assemble
them into a signed or unsigned integer using little-endian or big-endian
byte order.
Constexpr evaluation is supported in both the AST and bytecode
interpreters using the §7.18.21 formula directly. Runtime code
generation emits an integer load followed by llvm.bswap when the
requested byte order differs from the target endianness; 8-bit variants
never need a swap.
[CIR][AMDGPU] Support load to LDS and cluster load builtins (#233756)
Lower __builtin_amdgcn_load_to_lds, load_async_to_lds and
cluster_load_b{32,64,128} to their overloaded intrinsics, matching
classic codegen
RuntimeLibcalls: Use correct type for LDbl
Use the Module / Triple's correct long double type. Previously this
was hardcoded to assume double.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
[CIR][SPIR-V] Use the program address space for function aliases (#233720)
Alias initializer pointer was hardcoded to address space 0, which trips
an assertion on spirv64-amd-amdhsa where functions live in space 4
RegAlloc: Fix dead flags of defs after failed allocation
After an allocation failure, the error register may be assigned to
multiple defs of the same instruction. If one of these is dead and
another live, the instruction fails the verifier check added in #233110.
In RegAllocBase, add the failed defs to the error register's regunit
live ranges so a later assignment cannot also def it, and make the dead
flags of the error defs agree with any def already assigned the
register. In RegAllocFast, clear the dead flags of registers with a
live def on instructions using an error assignment.
Co-Authored-By: Claude Opus 5.5 <noreply at anthropic.com>
[lldb][Fortran] Added support for base types to DWARFASTParserFortran (#223406)
This PR adds support for base types to DWARFASTParserFortran, introduces
a method to retrieve the parser from TypeSystemFortran, and adds unit
tests for type parsing.
Changes:
- Added DW_TAG_base_type handling to ParseType.
- Added scope resolution for parsed types.
- Added a method to return the parser from TypeSystemFortran.
- Added unit tests to verify that base types are parsed correctly.
Relates to #109119.
[SLP]Limit rejected tree size for reductions
The overlapping windows of the same reduction rebuild almost the same
trees. Long reductions, like the runtime check chains, spend most of
the time on the rejected wide windows. Like the scheduling region, the
size of the next tree, estimated by the last rejected one, is limited
by -slp-reduction-budget (default is 65536 scalars), reduced by the
sizes of the rejected trees, but not below 2048 scalars, so the
smaller trees are still analyzed. The non-power-of-2 widths get only
2048 scalars for the rejected trees. The budget limits only the series
of the rejected trees, the vectorized tree starts a new series.
Fixes #229372
Assisted-by: Cursor
Reviewers: RKSimon, bababuck
Pull Request: https://github.com/llvm/llvm-project/pull/232884
[SLP]Treat trunc X to i1 as bit test (and X, 1) != 0
InstCombine canonicalizes icmp ne (and X, 1), 0 to trunc X to i1,
which blocked bundling it with the other bit tests. Model it as icmp
eq/ne.
Fixes #230768
Assisted-by: Cursor
Reviewers: bababuck, RKSimon
Pull Request: https://github.com/llvm/llvm-project/pull/233124
[lldb][Fortran] Added support for base types to DWARFASTParserFortran, tests for DWARFASTParserFortran and a method to get the parser from TypeSystemFortran
[lldb][Fortran] Added support for basic types in TypeSystemFortran (#223380)
This PR adds support for Base Types (INTEGER, LOGICAL, COMPLEX, REAL).
Changes:
- Adds methods to create types through the FortranType class.
- Manages type lifetimes using a SmallVector.
- Prevents duplicates using a FoldingSet.
- Allows retrieving information about the size, name, and kind of base
type.
Testing is done through TestTypeSystemFortran, which will have all tests
relating to the Type System.
Part of the Add Fortran support to LLDB GSoC 2026 project.
Relates to #109119.
[LiveDebugVariables] Add tests for canonicalizeIndexes (#225375)
Test various paths that leave stale SlotIndexes that reach
canonicalizeIndexes.
Co-authored-by: Claude Opus 5 (1M context) <noreply at anthropic.com>
[clang][OpenMP] Extend no-loop promotion to the split teams loop
Widen the no-loop promotion to apply not only to the fused target teams
distribute parallel for but include the same region written as separate
directives, other directives promotable to parallel for, and regions
carrying a schedule clause that asks for a mapping a no-loop kernel
already provides.
Use the SPMD_NO_LOOP kernel tag to carry the promotion decision, based
on whether the kernel can get fully promoted to a no-loop kernel. This
eliminates the previous discrepancy where a clause got the tag but not
the promotion.
[CodeGen] Allow inserting a block that starts with debug instructions in SlotIndexes (#233453)
SlotIndexes::insertMBBInMaps used the index of the new block's first
instruction to decide where to insert the block's start entry. Debug and
pseudo probe instructions have no index, so splitting a block with
LiveIntervals available crashed if the new block started with one. For
example, SIWholeQuadMode splits a block after a lowered demote, and a
DBG_VALUE following the demote made llc crash with -g.
Use the first instruction that has an index instead, or the end of the
previous block if there is none.
Co-Authored-By: Claude Opus 5.5 <noreply at anthropic.com>
[libc++] Mark xopen_source test unsupported on OpenBSD (#233710)
OpenBSD's headers strictly honor _XOPEN_SOURCE. With 500 and 600 the
POSIX.1-2008 locale API (locale_t, uselocale(), LC_*_MASK) is hidden,
and with any value below 800 asprintf() is hidden since it is only
exposed for POSIX.1-2024 or the BSD namespace. libc++'s OpenBSD locale
support relies on these from public headers, so every generated test
fails.
Mark the test unsupported on OpenBSD targets, as is already done for
FreeBSD.
[AMDGPU] Restrict VI VOP3P reals to GFX9. NFCI. (#232069)
VOP3P_Real_vi used HasVOP3PInsts as its AssemblerPredicate, which was
equivalent to GFX9 when VOP3P was introduced, but GFX10+ also have
FeatureVOP3PInsts. This meant that on GFX10+ the asm matcher could
match both the VI real and the real for the current generation, which
have different encodings. It only selected the right one because the VI
reals are defined later.
Use isGFX9Only instead. All GFX9 targets have FeatureVOP3PInsts, and
GFX8 does not have FeatureGFX9Insts, so this does not change which
targets the VI reals are available on, apart from excluding GFX10+.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply at anthropic.com>
Co-Authored-By: Ivan Kosarev <ivan.kosarev at amd.com>
[CostModel] Generic equal type cost model partial reduce (#229426)
When trying to enable partial reductions as a default reduction step in
#228481, a regression was found where a loop that would have been
unrolled if the steps were plain add instructions no longer unrolled.
This is due to inaccurate costs in the default path, especially for code
size.
This updates the basic TTI cost functions to return the cost of the
equivalent arithmetic instruction in the case the input and accumulator
types are the same, otherwise falls back to querying the backend with an
ISD opcode.