[llvm] [SLP]Initial support for non-power-of-2 (but still whole register) number of elements in operands. (PR #107273)

Martin Storsjö via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 26 00:36:43 PDT 2024


mstorsjo wrote:

This still triggers failed asserts for me:
```c
typedef struct {
  int *a[][4]
} b;
void *c;
int d;
void e() {
  b *f = c;
  int g, h = d;
  g = 0;
  for (; g < h; g++)
    f->a[1][2][g] = f->a[1][3][g] = f->a[2][0][g] = f->a[2][1][g] =
        f->a[2][2][g] = f->a[2][3][g] = f->a[3][0][g] = f->a[3][1][g] =
            f->a[3][2][g] = 0;
}
```
```
$ clang -target x86_64-linux-gnu -c -O2 repro.c 
clang: /home/martin/code/llvm-project/llvm/include/llvm/ADT/SmallVector.h:291: T& llvm::SmallVectorTemplateCommon<T, <template-parameter-1-2> >::operator[](llvm::SmallVectorTemplateCommon<T, <template-parameter-1-2> >::size_type) [with T = unsigned int; <template-parameter-1-2> = void; llvm::SmallVectorTemplateCommon<T, <template-parameter-1-2> >::reference = unsigned int&; llvm::SmallVectorTemplateCommon<T, <template-parameter-1-2> >::size_type = long unsigned int]: Assertion `idx < size()' failed.
```

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


More information about the llvm-commits mailing list