[AArch64] Remove unused private member variables in MachineSMEABI (NFC) (#243323)
MachineSMEABI::OptLevel: The last use was removed on February 3, 2026 in
commit 79eb804954bee06a62a3d31c697652f6dce982b1. This patch also
removes the now-unused OptLevel parameter from the MachineSMEABI
constructor and createMachineSMEABIPass.
MachineSMEABI::MLI: This member variable was added on October 28, 2025
in commit 57d4c90dac1b6fc8e25f1ba52cdf1189f4ceefa1 without any uses.
Assisted-by: Antigravity
[OpenMP][Archer] Isolate taskwait-depend test variables in TSan shadow cells (#242140)
`races/taskwait-depend.c` can produce no expected race report even after
all ten `deflake.bash` attempts. On AArch64 Linux, the unchanged test
reproduced this empty-output failure in 41 of 100 `ignore_serial=1`
wrapper invocations.
Align `x`, `y`, and `sem` separately to 8 bytes so they occupy different
TSan shadow cells. In the inspected unpatched assembly, `x` and `y`
share one cell. TSan's bounded access history makes the later `y` report
sensitive to intervening accesses to `x`; separating their histories
stabilizes the expected report. The original task scheduling, two-thread
team, and report checks are preserved, with the checked source line
numbers updated.
Fixes #117773.
Validation on AArch64 Linux, using Clang 18.1.3 with source-built
libomp/Archer and an existing LLVM 24 development TSan shared-runtime
[15 lines not shown]
[AArch64] Remove Interleave Intrinsics handling from IA (#234342)
Interleave Intrinsics can directly be lowered in AArch64 codegen for
both scalable and fixed vectors.
[lldb] Strip authentication bits when SBValue::Cast drops __ptrauth (#242399)
`SBValue::Cast` to a type without the `__ptrauth` qualifier keeps the
authentication bits in the value, as shown below:
```
(lldb) script pSpecial = lldb.frame.FindVariable("pSpecial"); print(pSpecial)
(__ptrauth(2,0,0) intp) pSpecial = (actual=0x100008000) 0x0014800100008000
(lldb) script print(pSpecial.Cast(lldb.frame.FindVariable("pNormal").GetType()))
(intp) pSpecial = 0x0014800100008000
```
The fix is to call `GetStrippedPointerValue` in `UpdateValue` if the
parent's
type has the `__ptrauth` qualifier and the cast type does not, and to
hold the
stripped pointer as a `Scalar`. Since `UpdateValue` rebuilds a `Scalar`
value,
a write to it is lost, so override `ValueObjectCast::CanSetValue` to
[10 lines not shown]
[BOLT][AArch64] Error when LongJmp will relax beyond 128MiB (#229882)
**Before**: LongJmp can relax non-call branches beyond 128MiB using
stubs that clobber `x16`, causing runtime crashes when branching between
hot and cold code.
**After**: LongJmp will emit an error and exit in this case
Assisted-by: Codex
[Plugins] Provide PreCodeGenCallback with all runCodeGenPipeline params (#241314)
Provide plugins with all the parameters that llvm::runCodeGenPipeline()
takes. It lowers the bar for them to run an LLVM-based pipeline of their
own. The plugin API already changed in this release cycle, so
`LLVM_PLUGIN_API_VERSION` remains at 3.
Co-authored-by: Claude Opus 5.5 <noreply at anthropic.com>
[Offload][Omp][Acc][NFC] Restructure offload directory (#242220)
Create a src and include directory for libomptarget and libompaccsupport
following the same structure as liboffload.
Move headers from the base include directory to the directories that use
them.
Just a few utility headers remain in the share base include/Shared
directory. Of those, Environment.h and RPCOpcodes.h seem questionable
but seem in used in both the plugins and libomptarget (which seems to
point to further refactoring needed).
Changes in source files are basically due to directory changes, leftover
headers, and in a few cases, changing headers that were only used
transitively for their own dependence.
Headers in libompaccsupport seem like they could be further refined as
they contain both shared and things only neeeded by libomptarget, but
[2 lines not shown]
[AArch64][GlobalISel] Run sdiv_by_const in the post-legalizer combiner (#242643)
A `<2 x i64>` sdiv or srem by a constant is not expanded by the
pre-legalizer combiner, because `<2 x i64>` `G_SMULH` is not legal. The
legalizer then scalarizes the `G_SDIV`, and the resulting i64 divides
were selected as `sdiv` instructions. This runs `sdiv_by_const` in the
post-legalizer combiner so they are expanded into `smulh` and shifts, as
SelectionDAG does.
After legalization the combine can no longer rely on the legalizer to
split or widen an illegal `G_SMULH`, so `matchSDivOrSRemByConst` now
requires `G_SMULH` to be legal for the type in that case. Without this
it creates an i32 `G_SMULH` that cannot be selected.
```
define <2 x i64> @test(<2 x i64> %a) {
%r = sdiv <2 x i64> %a, <i64 7, i64 6>
ret <2 x i64> %r
}
[37 lines not shown]
[LV] Address post-commit comments on #233782 (#241313)
A few NFC clean ups and updating the verifier to recognize an extract
from an active-lane-mask as a prefix mask.
[mlir][SCF] Support unsigned loops and iter_args in extractFixedOuterLoops (#241701)
See #240306 before reading
`stripmineSink` asserted on `scf.for` loops that use unsigned
comparisons, as it computes the strip bound with `arith.minsi` and
creates the inner loops with signed comparisons.
`extractFixedOuterLoops` did not check for this, so
`--test-extract-fixed-outer-loops` crashed on valid IR that had an
unsigned loop.
Instead of bailing out on unsigned loops, `stripmineSink` now emits the
right signedness: the strip bound uses `arith.minui` for unsigned loops,
and the new inner loop gets the same `unsignedCmp` as the loop it was
strip-mined from.
`stripmineSink` now also threads iter_args through the new inner loop,
which removes the iter_args bail-out from #184106. Tiling more than one
loop reorders the iterations, which can change the result of
[7 lines not shown]
[LoopPeel] Peel last iteration to enable load widening
In loops that contain multiple consecutive small loads (e.g., 3 bytes
loading i8's), peeling the last iteration makes it safe to read beyond
the accessed region, enabling the use of a wider load (e.g., b32) for
all other N-1 iterations.
Patterns such as:
```
%a = load i8, ptr %p
%b = load i8, ptr %p+1
%c = load i8, ptr %p+2
...
%p.next = getelementptr i8, ptr %p, 3
```
Can be transformed to:
```
%wide = load b32, ptr %p ; Read 4 bytes
[19 lines not shown]
[mlir][scf] Read the written tile of a `scf.forall` through block arg (#241838)
When a producer of the init of an `scf.forall` is fused into the loop,
the fused op reads the init from outside the loop, while the iteration
writes the same tile through the `shared_outs` block argument. One-shot
bufferize cannot prove that these touch the same tile, so it allocates a
buffer and copies the whole tensor.
E.g., after tiling a `linalg.mmt4d` and fusing the `linalg.pack` of its
accumulator:
```mlir
%r = scf.forall (%i, %j) in (8, 8) shared_outs(%out = %C) -> (tensor<96x64xf32>) {
%c = tensor.extract_slice %C[%off0, %off1] [12, 8] [1, 1] // reads the outer value
...
scf.forall.in_parallel {
tensor.parallel_insert_slice %u into %out[%off0, %off1] [12, 8] [1, 1]
}
}
[15 lines not shown]
[flang][OpenMP] Emit portability warning on simd do with firstprivate & lastprivate (#242294)
Currently using `!omp parallel do simd lastprivate(a) firstprivate(a)`
does not copy the value of `a` into its body.
E.G.
```fortran
integer a
a=10
!$omp parallel do simd lastprivate(a) firstprivate(a)
do i=1,1
if (a/=10) print *, 'Fail'
end do
!$omp end parallel do simd
end
```
Prints fail.
The result of discussion on
https://github.com/llvm/llvm-project/pull/236741 and other PRs was that
this behaviour correctly implements the OpenMP spec, since `!$omp do
[9 lines not shown]
[DAG] SimplifyDemandedVectorElts - fdiv/frem of zero elements is NaN, not known zero (#241878)
`SimplifyDemandedVectorElts` treats an `fdiv`/`frem` element as known
zero when both operands are known zero, but `0.0 / 0.0` and `frem(0.0,
0.0)` are NaN. This dates back to 4cf1da0e021b, which added the FP
binops to the integer `ADD`/`SUB` case.
This patch stops reporting known zero elements for `FDIV` and `FREM`.
Fixes #241254
Assisted-by: Claude Opus 5.5
[CIR] Fold extractvalue when lowering complex real and imag
Lower cir.complex.real and cir.complex.imag with createOrFold, so the
llvm.extractvalue folds through the llvm.insertvalue chain that
cir.complex.create lowers to. Until now the fold depended on the CIR
folders seeing the original cir.complex.create, which only happens
while dialect conversion keeps replaced ops around for rollback. The
LLVM folder works on the converted values in either mode and also
catches extracts of complex results that never came from a
cir.complex.create, such as the cir.complex.fadd result in
complex-compound-assignment.cpp, which now matches classic codegen.
Assisted-by: Claude Code (claude-opus-5-5).
[X86] Add i16 partial reduction tests for targets without VNNI (NFC) (#240903)
Adds test coverage for i16 × i16 → i32 partial reductions on targets
without VNNI, ahead of lowering them to PMADDWD (#223374).
- `vector-partial-reduce-smla.ll`: sext-only and mismatched-extend
cases.
- New `vector-partial-reduce-smla-widen.ll`: `<4 x i16>` inputs with a
`<4 x i32>` accumulator, which need input widening. It has non-VNNI RUN
lines only, since this shape crashes on VNNI targets today (TODO in the
file).
- `LoopVectorize/X86/CostModel/partial-reduce-dot-product.ll`: s16 × s16
on SSE2, AVX1, AVX2 and AVX512BW, and a negative u16 × u16 case.
Code drafted by both human and AI, and reviewed by human.
[lldb][Darwin] Batch debugserver Mach-O load-command reads (#232684)
**Why:** During attach, debugserver reads each image's Mach-O
load-command headers and payloads separately. Targets with many dynamic
libraries repeat this work across every image.
**Change:** Read commands through a bounded 16 KB window. Keep
breakpoint-byte restoration and command validation; fall back to an
exact read when optional data is unreadable. This PR changes the
server-side traversal.
**Validation:** Standalone arm64 debugserver builds; four API cases pass
with matching current-main LLDB and with Apple LLDB. They cover parsing,
window boundaries, breakpoints, unreadable data and malformed commands.
A 32-bit inferior has not been tested.
<details>
<summary>Prior reviews</summary>
[14 lines not shown]