[llvm] [LV] Add initial support for vectorizing literal struct return values (PR #109833)

David Sherwood via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 14 03:42:18 PST 2025


================

----------------
david-arm wrote:

Given you've changed the scalarisation overhead it would be good to have some tests for predication here too. For example, you can have a call inside a block in the original scalar code, you can force predication like you did with the scalable tests, and you can have users of your calls inside predicated blocks that cannot be if-converted, i.e.:

```
for (unsigned i = 0; i < n; i++) {
  struct { int a, int b } s = foo(...);
  if (mask[i]) {
    r[i] /= s.a;
  }
}
```

Since we cannot allow divide by zero the divides will need to be in predicated blocks, forcing the values returned by `foo` to be extracted one lane at a time.

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


More information about the llvm-commits mailing list