[PATCH] D78054: [VFDatabase] Scalar functions are vector functions with VF =1
Masoud Ataei via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Apr 27 14:01:13 PDT 2020
masoud.ataei marked an inline comment as done.
masoud.ataei added inline comments.
================
Comment at: llvm/test/Transforms/LoopVectorize/vectorizeVFone.ll:8
+; CHECK-LABEL: getScalarFunc
+; CHECK-NOT: call fast <{{[0-9]+}} x double> @{{.*}}atan{{.*}}(<{{[0-9]+}} x double> %{{[0-9]+}})
+entry:
----------------
fpetrogalli wrote:
> Are you sure you are checking the right thing here? If vectorization happens with VF = 2, you wouldn't be catching this because the VFDatabase would be redirecting the VF=2 call to `__atand2_massv`, as specified by the VFABI attribute below. If my understanding is correct, whaat you want to test here is that the compiler doesn't crash, and that it does not emit vector code. I think that should be tested by:
>
> ```
> ; CHECK-LABEL: getScalarFunc
> ; CHECK-NOT: <{{[0-9]+}} x double>
> ```
I checked the force vectorize with vectorization factor=2, and I get this line:
```
%10 = call fast <2 x double> @__atand2_massv(<2 x double> %9)
```
So this will be caught by that check. About `__atand2_massv` function, regular expression `{{.*}}atan{{.*}}` will trigger it.
The reason that I cannot simply check for `<{{[0-9]+}} x double>` is this: There is
```
declare <2 x double> @__atand2_massv(<2 x double>) #1
```
declaration in IR when you want to do vectorization. So `CHECK-NOT: <{{[0-9]+}} x double>` will always return true.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D78054/new/
https://reviews.llvm.org/D78054
More information about the llvm-commits
mailing list