[llvm] [DAG] expandVecReduce - widen sub-legal vectors to not prematurely scalarize later reduction levels (PR #194672)

Martin Storsjö via llvm-commits llvm-commits at lists.llvm.org
Fri May 1 03:44:13 PDT 2026


mstorsjo wrote:

This is causing failed asserts for the ARM target, in ffmpeg, x264, libgcrypt and more.

One minimized repro:
```c
char a;
long long b;
void c() {
  b = (&a)[0] | (long long)(&a)[1] << 8 | (&a)[2] | (&a)[3] | (&a)[4] |
      (&a)[5] | (&a)[6] | (&a)[7];
}
```
```console
$ clang -target armv7-linux-gnueabihf -c repro.c -O2
clang: ../lib/CodeGen/SelectionDAG/SelectionDAG.cpp:8829: llvm::SDValue llvm::SelectionDAG::getNode(unsigned int, const llvm::SDLoc&, llvm::EVT, llvm::SDValue, llvm::SDValue, llvm::SDValue, llvm::SDNodeFlags): Assertion `(VT.isScalableVector() != N2VT.isScalableVector() || VT.getVectorMinNumElements() >= N2VT.getVectorMinNumElements()) && "Insert subvector must be from smaller vector to larger vector!"' failed.
```

https://github.com/llvm/llvm-project/pull/194672


More information about the llvm-commits mailing list