[clang-tidy][NFC] Move isLocalVarDecl matcher into utils::Matchers (#228544)
The second commit of Matcher cleanup in Clang-tidy
AI Usage: Assisted by Grok 4.6 (Cursor)
---------
Co-authored-by: Cursor <cursoragent at cursor.com>
[SROA] Speculate selects through addrspacecasts (#234350)
Enable select speculation to look past addrspacecast operations.
Previously, a load or store of `addrspacecast (select c, p, q)` was not
recognized as a memory operation of the select, so SROA gave up and the
alloca was not promoted. This pattern is added for GPU targets, which
make use of multiple address spaces.
The cast is recreated on each select operand so the new accesses keep
their original pointer type. Volatile accesses still block the
transform.
[AMDGPU] Enable SlotIndexes compaction by default (#235806)
Add TargetRegisterInfo::shouldCompactSlotIndexes() so targets can opt
in to dropping dead SlotIndexes entries before greedy allocation, one
target at a time. An explicit -greedy-compact-slot-indexes still
overrides the target. Enable it for AMDGPU.
[SLP]Extend demoted GEP index to original type
GEP sign-extends narrow indices, so a demoted unsigned index
produced wrong addresses.
Fixes #236182
Assisted-by: Cursor
Reviewers:
Pull Request: https://github.com/llvm/llvm-project/pull/236791
[AMDGPU] Address review: note MI308X with PTL off, test 32x32 SMFMAC
Say in getVALUIssueCycle's comment which gfx942 parts the helpers model:
MI300X, which has no limiter setting, and MI308X with the peak TOPS
limiter enabled. With the limiter disabled, MI308X holds VALU until an
XDL's passes end.
Add v_smfmac_f32_32x32x16_f16 to the gfx942 and gfx950 issue cycle
tests. Measured with ATT on MI308X (limiter enabled) and MI350X: VALU at
cycle 2 and PK_F32 at cycle 10.
[AMDGPU][GlobalISel] Add IR test for uniform i64 unmerge into i16 (#233415)
Follow-up to #232954: add an end-to-end test where RegBankLegalize
unmerges a uniform i64 into 16-bit pieces.
[Offload][Omp] Remove references to GenericKernelTy from libomptarget (#236732)
Two new properties (`KERNEL_STATIC_BLOCK_MEM_SIZE` and
`KERNEL_MAX_THREADS`) were added to query the kernel properties that
libomptarget was querying directly.
Decouple RecordReplay from `GenericKernelTy` by introducing a new
`KernelInfoTy` structure that only carries the subset of information
that RR needs.
For now, libomptarget still needs access to `DeviceImageTy` to get some
that information.
Assisted by Claude.
[libc++] Add __uninitialized_allocator_{fill_n,value_construct_n,move} and use them in vector (#167112)
This makes us more predictable in when we destruct elements and makes us
consistently use `__uninitialized_allocator_` throughout `vector`.
Fixes #59293
---------
Co-authored-by: Louis Dionne <ldionne.2 at gmail.com>
Co-authored-by: Nikolas Klauser <nikolasklauser at berlin.de>
[offload][L0][NFC] Move LevelZeroPluginContextTy to L0Context.{h,cpp} (#236111)
Move `LevelZeroPluginContextTy` out of `L0Plugin.h`/`L0Plugin.cpp` into
its own `L0Context.h`/`L0Context.cpp`.
The #236105 rename (`L0ContextTy` -> `L0DriverTy`, `L0Context.*` ->
`L0Driver.*`) freed up the `L0Context` file names, so they now hold the
plugin-side context type, matching their name.
Other changes are limited to wiring:
- Add `src/L0Context.cpp` to `LEVEL_ZERO_SRC_FILES`.
- Include `L0Context.h` from `L0Plugin.h`, `L0Plugin.cpp` and
`L0Driver.cpp`
(`L0DriverTy` owns the default `LevelZeroPluginContextTy`).
No functional change.
Assisted-by: Claude Opus 5.5
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
[gn] add missing deps to llvm/tools/llc/lib (#236774)
llcdriver.cpp and NewPMDriver.cpp transitively include
generated llvm/IR/Attributes.inc and
llvm/Analysis/TargetLibraryInfo.inc,
so add a dep on them.
(In CMake, it depends on intrinsics_gen, and intrinsics_gen depends on
analysis_gen.)
[AMDGPU][CodeGen] Allow remat with multiple users in multiple regions (#215598)
This relaxes one of the constraints on rematerialization candidates in
the scheduler's `PreRARematStage`. The current implementation only
allows rematerializing a register if it has users in a single region.
This allows it when a register has multiple users in multiple regions.
In such cases the register is rematerialized as many times as there are
using regions, just before the first user in each using region. The cost
model for assessing rematerialization opportunities now takes into
account that multiple new instructions may be created for each
candidate.
[libc++abi] Return whether a dynamic_cast/catch search finished (#230445)
This avoids reading/writing memory in a lot of places for a simple,
commonly used flag.
[AArch64] Remove unused SME intrinsics (#236707)
These intrinsics are a remnant of the initial implementation of SME in
LLVM. SME state is now handled by function attributes so these
intrinsics should not be used.
[LLVM][SelectionDAG] Improve vector index clamping. (#235033)
Refactor clampDynamicVectorIndex to make the result more consistent
across fixed-length and scalable vectors. Originally the function
assumed Idx will be scaled by vscale when SubEC is scalable. This PR
makes things more explicit by ensuring callers first compute the real
index to be clamped.
While this makes clampDynamicVectorIndex useful in more contexts, the
existing uses remain unchanged. Those are: (1) clamping a variable index
for a single lane; and (2) clamping a constant index for a subvector.
To make (2) more explicit this PR adds the necessary assert to
getVectorSubVecPointer. Doing this allows ISD::VSCALE to be used for
scalable subvector indices, removing the need for discrete arithmetic.
This in turn allows clampDynamicVectorIndex to better support scalable
vectors by removing unecessary clamping to maintain existing code
quality.
[2 lines not shown]
[gn] port 749d82099196 (#236771)
Uses len(), which needs GN version 2281 or newer, so bump the
minimum GN version to that.
(Run `llvm/utils/gn/get.py` to update your GN binary.)
[mlir][OpenACC] Fold constant-false host_data with an empty region (#236052)
`RemoveConstantIfConditionWithRegion` replaces a construct whose `if`
condition is constant false with the contents of its region. The helper
it uses asserts that the region has exactly one block, but
`acc.host_data` accepts an empty region, so canonicalizing one crashed.
An empty region has nothing to inline, so the op is now simply erased in
that case, which matches what happens for a non-empty region.
Multi-block regions now bail out instead of asserting.
Fixes #231828
[SLP]Keep original order of poisonous values in logical reductions
Logical and/or ops mask the poison of a reduced value by all preceding
values. Repeated values, constants and leftovers were combined out of
order, and an operand-0 leaf was assumed unconditional. Combine only
non-poisonous parts out of order; emit poisonous scalars after them,
sorted by original position, with repeated values dropped.
Fixes #236181
Assisted-by: Cursor
Reviewers:
Pull Request: https://github.com/llvm/llvm-project/pull/236778