[ABI][AARCH64][NFC] Make SveCount a unique type (#245767)
The LLVM ABI library previously modeled SveCount (the AArch64
predicate-as-counter type) as a vector with a special kind to
distinguish it. Upon further reflection, this seems to have been a bad
choice as this type has almost no overlap with other vector types apart
from the fact that it occupies a predicate register.
This change separates SveCount as a separate type in the ABI library.
The classification and the LLVM IR type to which it is mapped remain
unchanged.
Assisted-by: Cursor / various models
[Clang][OpenMP] Fix static,1 inner loop bound (#239868)
The inner loop of a combined distribute parallel for compared its
iteration variable directly with .previous.ub., whose parameter type is
uintptr_t. This could widen a signed i32 iteration variable to i64 and
make the comparison unsigned.
Reuse the existing conversion of .previous.ub. to the loop upper-bound
type when building the inner-loop condition. Update the affected OpenMP
codegen checks and add a focused test for signed and unsigned i32 loops.
Assisted by gpt-6.
[mlir] Add @FedericoBruzzone as a co-maintainer of `Vector` (#245162)
Since starting his upstream involvement earlier this year, Federico has
become a very active and recognisable contributor to `Vector` (PRs,
reviews, RFCs).
From the beginning, Federico's `Vector` interests extended beyond his
own PRs. Indeed, he has reviewed 4 times as many PRs as he has submitted
himself! In addition, he has been putting a lot of effort into tracking
`Vector` activity on GitHub (there's been a lot). See e.g.:
* https://github.com/llvm/llvm-project/issues/235708
This PR simply formalises what Fede has already been doing informally.
[mlir][SPIR-V] Deserialize constant composites with OpUndef constituents (#245516)
spirv.Constant cannot hold undef values, so build such vectors, arrays
and structs with spirv.CompositeConstruct at each use
[mlir][SPIR-V] Add SPIRVToLLVM conversion for PtrEqual and PtrNotEqual (#242826)
Use adaptor operands in IComparePattern because pointer operand types
change during conversion
Depends on https://github.com/llvm/llvm-project/pull/242824
[AArch64] Fold cmpne of a predicated non-zero splat into an AND (#242813)
`performSetccMergeZeroCombine` already folds `cmpne(pg, sext(p), 0)` to
`and(pg, p)`. The SVE intrinsic form `svdup_z(p, C)`
(`DUP_MERGE_PASSTHRU`) and the IR form `select(p, splat(C), 0)` did not
match it, so the SVE -> NEON -> SVE predicate round trip from the issue
compiled to:
mov z0.b, p0/z, #-1
ptrue p0.b, vl16
cmpne p0.b, p0/z, z0.b, #0
The fold now also accepts a predicated dup or select of an integer
constant C != 0 with a zero passthru. These are non-zero exactly in the
lanes where `p` is active. Only the low bits of C are checked, because
the dup scalar is any-extended to i32. Output is now:
ptrue p1.b, vl16
and p0.b, p0/z, p0.b, p1.b
[6 lines not shown]
[LAA] Find no dependence between non-overlapping loop-invariant accesses
A loop-invariant access touches the same bytes in every iteration, so
two of them are independent iff they do not overlap. LAA proved that
only by showing one ends before the other begins, e.g. p + 4 <=u p + 8
for a and c below, which fails unless SCEV knows the addresses do not
wrap. Otherwise it reported an unknown dependence and gave up on the
loop, so a loop that updates three or more fields of a struct through a
pointer was not vectorized:
struct trio { int a, b, c; };
void acc3(struct trio *p, const int *x, int n) {
for (int i = 0; i < n; i++) {
p->a += x[i];
p->b ^= x[i];
p->c |= x[i];
}
}
[13 lines not shown]
[MSan] [ASan] [TSan] Disable UTF conversion interceptors on Solaris and AIX (#246128)
https://github.com/llvm/llvm-project/pull/243270 added interceptors then
broke Solaris buildbots.
This PR disables the new interceptors on Solaris and AIX.
Assisted-by: Gemini
[CIR] Add support for __SVCount (#245456)
This adds CIR codegen support for __SVCount, introducing a new type to
represent it. Calling convention for this type is not yet implemented.
That will be handled in a future change.
Assisted-by: Cursor / claude-opus-5.5
[lldb] Don't crash when a function type cannot be built (#245153)
CreateFunctionType returns an invalid type when a return or parameter
type is still being resolved further up the stack. ParseSubroutine uses
the result unchecked and dereferences a null type:
```
Assertion failed: (!isNull() && "Cannot retrieve a NULL type pointer")
```
Report an error and return no type instead.
Assisted-by: Claude
[SampleProf] Add flag to allow re-reading loaded profiles with remapper (#244798)
Add a temporary hidden option
`-sample-profile-allow-reread-loaded-profile` (default `false`) to
restore the pre-#230386 behavior during incremental reads with a
remapper; this flag is temporary and for performance testing.
[X86] Fix mask indexing in the extractelement(bitcast(<X x i1>)) fold (#240715)
`combineExtractVectorElt` folds `extract_element(bitcast(<X x i1>))`
into an `EXTRACT_SUBVECTOR` of the mask, but sizes and indexes the
subvector by the result width instead of the source element width. The
result of `EXTRACT_VECTOR_ELT` may be wider than the element (and
`PEXTRB`/`PEXTRW` always return i32), so the fold could select the wrong
mask bits or build an out-of-bounds `EXTRACT_SUBVECTOR`.
Use the source element width, bitcast back to the element type, and
any-extend (zero-extend for `PEXTRB`/`PEXTRW`) to the result type.
Fixes #240704
AI assistance: Claude Code and ChatGPT were used for triage, patch
development and editing; the author reviewed the change and takes
responsibility for it.
[cir] Convert gpu.func and gpu.launch_func signatures with cir types (#245465)
In CIR + OpenACC, the OpenACC compute region will be converted and
outlined to a `gpu.func`. The CIR to LLVM conversion will handle the
body of the `gpu.func` fine but the signature will keep the CIR types.
This patch adds two patterns to be able to convert the types in the
signature as well.
---------
Co-authored-by: Erich Keane <ekeane at nvidia.com>
[Matrix] Implement matrix support for the `lerp` intrinsic (#243639)
Closes #184506.
This PR implements the matrix api for `lerp` and adds matrix codegen
tests and matrix sema tests. Matrix backend tests were not added because
no DirectX or SPIRV backend changes were made.
Assisted-by: Claude Opus 5.5
[lld][MachO] Pool relocation storage & sort relocs in ascending address order (#245184)
Currently, each subsection grows its own `std::vector` of relocations,
resulting in a lot of small allocations during relocation parsing, which
is costly. This PR allocates one relocation array per input section, and
each subsection takes a `RelocsArray` slice of it.
Some linker passes still need to dynamically `emplace_back()` into the
`RelocsArray`; since the slices are contiguous, they cannot expand
in-place, so we switch the `RelocsArray` storage to a per-subsection
heap-allocated buffer as needed. This is a similar to how `SmallVector`
behaves.
Additionally, we sort the relocations in ascending address order,
matching the order that subsections are sorted in. This means that
iterating over the relocations in subsection order can now benefit more
from the hardware prefetcher. (Previously, each subsection's relocations
were sorted in descending address order, but that did not matter as much
since the allocations were fragmented anyway.) This ordering results in
[3 lines not shown]