[llvm] [WIP][LoopVectorize] LLVM fails to vectorise loops with multi-bool varables (PR #89226)

Dinar Temirbulatov via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 10 02:47:50 PDT 2024


dtemirbulatov wrote:

We found issue with this enablement. For this example:
```
void foo(int *restrict a, int *restrict j, int n) {
 _Bool any = 0;
 _Bool all = 1;
 for (int i = 0; i < n; i++) {
  _Bool c = a[i] < 0;
  if (c)
   any = 1;
  else
   all = 0;
  j[i] = all ? 1 : any ? 2 : 3;
 }
}
```
In vectorized version of this loop, LV missed to introduce reductions for all and any variables. 

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


More information about the llvm-commits mailing list