[CIR] Accept fixed-width vectors in x86_64 callconv lowering (#215118)
The CallConvLowering bridge rejects a vector in a parameter or return
position, so a function taking one fails the pass. It also never reads
the AVX level, which is what decides whether a vector wider than 128
bits reaches a register.
A vector is accepted now where the classifier and clang size it the same
way, which means a whole-byte element and a power-of-two width. Scalable
vectors and the other widths stay rejected. The module's AVX level comes
from the target ABI name, as `CodeGenModule` does. A classifier per
level lets a target attribute raise it for one function. An ABI older
than the rule pins every function back to the module's level. A direct
call takes its callee's level, and an indirect call the level of the
function containing it.
CIRGen records target features on a definition but not on a declaration,
so a declaration carrying the attribute is classified at the module's
level until [#214986](https://github.com/llvm/llvm-project/pull/214986)
[4 lines not shown]
[mlir] Add shouldPromoteIfSingleIteration option to loopUnrollByFactor (#215080)
Add a shouldPromoteIfSingleIteration parameter to loopUnrollByFactor to
control whether single-iteration loops are promoted during unrolling.
When set to false, the function skips calls to promoteIfSingleIteration
on the main loop, epilogue loop, and the unroll-factor-1 early-exit
path.
The parameter defaults to true to preserve existing behavior.
[lldb-dap][NFC] Use wildcard imports for test decorators (#216235)
Replace explicit imports `from ... import (a, b, c)` with wildcard
imports `from ... import *` for `lldbsuite.test.decorators`,
This lets downstream forks introduce extra decorators (e.g. to skip
tests on private configurations) without needing to patch each test's
import list.
[Related
discourse](https://discourse.llvm.org/t/do-we-want-to-tighten-up-imports-in-the-api-testcases/91557/3)
[AArch64][CostModel] Adjust the cost of pure partial add reductions. (#214723)
These reductions can lower to a [SU]ADALP rather than a widening add
pair, so using partial reductions becomes profitable for two-way
widening reduction loops such as (https://godbolt.org/z/v8vr9Pzqb):
```c
long sadalp(const int *a, long n) {
long s = 0;
for (long i = 0; i < n; i++)
s += (long)a[i];
return s;
}
```
[Clang][Sema] Fix an ICE where structured binding packs within a lambda were not added to the CapturingScopeInfo (#214716)
Fixed a bug where structured binding packs within a lambda were not
added to the `CapturingScopeInfo` during `ActOnDecompositionDeclarator`,
which also led to invalid expressions being considered for delayed
lambda diagnostics, when they should have been diagnosed immediately.
Fixes #214160
Signed-off-by: Baba Dan Constantin <babadany2999 at gmail.com>
CodeGen: Remove TargetOptions::FloatABIType
This is now fully replaced with the "float-abi" module flag.
If the module flag is not present, the default is computed
from the triple. Consumers are updated to read the module flag.
RuntimeLibraryAnalysis now defers analysis until run() on a Module,
instead of during the pass constructor as before. This requires copying
all of the remaining relevant TargetOptions so they are available
when the module is seen.
Unfortunately, ARM still depends on TargetOptions for determining
the float-abi. -target-abi=aapcs16 still changes the default float-abi,
but an explicit module flag wins.
Co-authored-by: Claude (Claude-Opus-4.8) <noreply at anthropic.com>
CodeGen: Synthesize "float-abi" module flag from -float-abi
Avoid annoying test updates when the corresponding TargetOptions
field is removed. Make the -float-abi llc/opt option a lit test
convenience that records the floating-point ABI in the IR,
mirroring how -mcpu/-mattr are recorded as function attributes.
Co-authored-by: Claude (Claude-Opus-4.8) <noreply at anthropic.com>
lli: Record the host triple on triple-less modules (#216132)
The JIT compiles for the host, but modules without a target triple kept
an empty triple, which module-triple-based analyses (e.g. runtime
libcall selection) cannot resolve. Set the resolved JIT triple on the
module. This defends against jit test regressions when
RuntimeLibraryInfo
starts getting computed from the module instead of TargetOptions.
Co-authored-by: Claude (Claude-Opus-4.8) <noreply at anthropic.com>
[AMDGPU] Fix performFMACombine FDOT2 fold for subnormal handling (#205101)
The fold from v_fma_mix_f32 pairs to v_dot2_f32_f16/v_dot2c_f32_f16
was gated only on fp-contract flags, ignoring how each instruction
handles f16 subnormal inputs under different denormal modes.
Hardware testing across multiple GPU generations shows that gfx90a
(CDNA2) is the sole outlier: v_dot2c unconditionally flushes f16
subnormal inputs to zero in all MODE configurations, while v_fma_mix_f32
preserves them when ieee=1 (the default compute kernel mode). All other
tested GPUs with dot2 instruction do not flush f16 subnormal inputs.
Add GCNSubtarget::dot2UnconditionalFlush() to capture this hardware
quirk.
Gate the fold on the function's f32 denormal mode:
- dot2UnconditionalFlush(): allow fold only when f32 denorm =
PreserveSign, so both instructions flush f16 subnormals.
- All other GPUs: allow fold only when f32 denorm = IEEE, so both
instructions preserve f16 subnormals. Dynamic mode is also rejected
[9 lines not shown]
[X86][PartialReduction] Lower zext-byte add reductions to vpsadbw (#201076)
Loops of the form `for (i) sum += bytes[i];` (`uint8_t` input, `i32`/`i64` accumulator)
lower to `vpmovzxbd` + `vpaddd` today, although `PSADBW(x, 0)`
computes the same sum in one instruction per 128/256/512-bit lane.
Teach `X86PartialReduction` to rewrite the `zext <N x i8> to <N x i32|i64>`
leaves of an add reduction (N >= 16) into `PSADBW(x, 0)`, split across
SSE2/AVX2/AVX-512BW lanes per the subtarget. `i64` accumulators consume
`PSADBW`'s natural `<N/8 x i64>` output directly.
Tests: `x86-partial-reduction-byte-sum*.ll` (matcher in isolation),
`byte-sum-{positive,negative}.ll` (full CodeGen on +sse2/+avx2/+avx512bw).
[LLVM][CodeGen][SVE] Prefer uadalp over sabalb/sabalt. (#216301)
Partially reverts https://github.com/llvm/llvm-project/pull/212800
becuase for SVE2 using uadalp has better accumulator throughput than a
sabalb/sabalt sequence.
[X86][APX] Add missing VRM argument (#216240)
It happens when a rematerialized load is from global variable, see
https://godbolt.org/z/ddsh8PP4K
Assisted-by: Claude Opus 4.8