[llvm] [AArch64] Enable maximising scalable vector bandwidth (PR #166748)

Shunsuke Watanabe via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 1 23:02:54 PST 2025


s-watanabe314 wrote:

It seems our tests have started failing since this commit. I'm not familiar with the implementation details, so I'm not sure if this commit is the direct cause (it might be a latent issue).
The failing test is as follows. The environment is AWS Graviton3 (Neoverse-V1), and the test fails when using the options `-O3 -march=armv8.4-a+sve -msve-vector-bits=256`.

- Program ([0035_0013.cc](https://github.com/fujitsu/compiler-test-suite/blob/main/C%2B%2B/0035/0035_0013.cc))

```C++
#include <stdio.h>

void foo(int *a, long long int *b, short *c, int n) {
  int i;
  for (i = 0; i < n; ++i) {
    a[i] = a[i] + (int)b[i] * (int)c[i];
  }
}

int main(void) {
  int a[100];
  long long int b[100];
  short int c[100];
  int i, k = 0;

  for (i = 0; i < 100; ++i) {
    a[i] = i;
    b[99 - i] = i;
    c[i] = 1;
  }

  foo(a, b, c, 100);

  for (i = 0; i < 100; ++i) {
    k += a[i];
  }

  if (k == 9900) {
    printf("test : ok\n");
  } else {
    printf("test : ng : %d\n", k);
  }
  return 0;
}

```

- Result
```
$ clang++ 0035_0013.cc -O3 -march=armv8.4-a+sve -msve-vector-bits=256 -o result.out
$ result.out
test : ng : 9996
```

Do you have any insights into the cause?

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


More information about the llvm-commits mailing list