[llvm] [InterleavedAccess] Construct interleaved access store with shuffles (PR #164000)
Martin Storsjö via llvm-commits
llvm-commits at lists.llvm.org
Thu Nov 6 01:00:27 PST 2025
mstorsjo wrote:
This commit is causing failed asserts for me, this breaks compiling ffmpeg and libaom.
Two reduced reproducers for the issue:
```c
int a, b;
void c(char e) {
char *d = 0;
while (--b) {
d[b * 8 + 7] = d[b * 8 + 6] = e;
d[b * 8 + 5] = d[b * 8 + 4] = e & 1;
d[b * 8 + 3] = e;
d[b * 8 + 2] = a;
d[b * 8 + 1] = d[b * 8] = e;
}
}
```
```
$ clang -target aarch64-linux-gnu -c -O2 repro.c
clang: ../lib/IR/Instructions.cpp:1765: llvm::ShuffleVectorInst::ShuffleVectorInst(llvm::Value*, llvm::Value*, llvm::ArrayRef<int>, const llvm::Twine&, llvm::InsertPosition): Assertion `isValidOperands(V1, V2, Mask) && "Invalid shuffle vector instruction operands!"' failed.
```
```c
typedef __attribute__((neon_vector_type(16))) unsigned char a;
typedef __attribute__((neon_vector_type(4))) short b;
typedef __attribute__((neon_vector_type(2))) int c;
typedef __attribute__((neon_vector_type(4))) int d;
typedef struct {
b e[2]
} f;
typedef struct {
c e[2]
} g;
f h;
b i;
a k;
g m, n;
c o, p, q, r;
f j(b s) {
__builtin_neon_vzip_v(&h, i, s, 17);
return h;
}
b l();
void t() {
a u;
f v = j(l()), w = j(l()), a = h, b = j(l());
r = v.e[0];
q = w.e[0];
g c;
__builtin_neon_vzip_v(&c, r, q, 18);
n = c;
p = a.e[0];
o = b.e[0];
__builtin_neon_vzip_v(&c, p, o, 18);
m = c;
{
d d = __builtin_shufflevector(n.e[1], m.e[1], 0, 1, 2, 3);
u = d;
}
k = u;
}
```
```
$ clang -target aarch64-linux-gnu -c -O2 repro.c
clang: ../lib/IR/Type.cpp:804: static llvm::FixedVectorType* llvm::FixedVectorType::get(llvm::Type*, unsigned int): Assertion `NumElts > 0 && "#Elements of a VectorType must be greater than 0"' failed.
```
I will push a revert shortly.
https://github.com/llvm/llvm-project/pull/164000
More information about the llvm-commits
mailing list