Issue 238869
Summary [LV][AArch64] Conditional scatter loop vectorized unprofitably after #232519
Labels new issue
Assignees
Reporter yafet-a
    @fhahn After #232519 (23d4229f) we see a ~40-45% regression on one of our workloads on Neoverse V2. The loop below was previously left scalar and is now vectorized at VF 4, which ends up as vector compares followed by per-lane extracts and scalar stores.

```c
void kernel(const long *restrict c, int *restrict list, long n) {
  for (long i = 0; i < n; ++i)
    if (c[i] != c[i + 1])
      list[c[i]] = i;
}
```

Ran with `clang -O3 -mcpu=neoverse-v2 -Rpass=loop-vectorize -c scatter.c`. At 17d22b6d the loop isn't vectorized. At 23d4229f it's `vectorized loop (vectorization width: 4, interleaved count: 1)` and about 65% slower in a standalone run (n = 1M, ~50% of the conditions true).
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to