[PATCH] D99951: [NFC] Add scalable vectorisation tests for int/FP <> int/FP conversions

David Sherwood via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 23 04:00:38 PDT 2021


david-arm marked 2 inline comments as done.
david-arm added inline comments.


================
Comment at: llvm/test/Transforms/LoopVectorize/AArch64/sve-type-conv.ll:156-157
+  %0 = load i64, i64* %arrayidx, align 8
+  %conv = uitofp i64 %0 to float
+  %conv1 = fptrunc float %conv to half
+  %arrayidx2 = getelementptr inbounds half, half* %dst, i64 %i.08
----------------
kmclaughlin wrote:
> I'm not sure why this test and the one below are using both a `[u|s]itofp` and an `fptrunc`, is it possible to just use `uitofp i64 %0 to half` here?
Yeah, this is an artefact of clang. When compiling a loop such as this:

```
void foo(float16_t *dst, uint64_t *src, long long n) {
  for (long long i = 0; i < n; i++)
    dst[i] = src[i];
}
```

it generates IR with two-part conversions, i.e. uitfop + fptrunc. Not sure why, but I've changed the test anyway.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D99951/new/

https://reviews.llvm.org/D99951



More information about the llvm-commits mailing list