[llvm] [SLPVectorizer] Support SLPVectorizer cases of tan across all backends (PR #95517)
Alexey Bataev via llvm-commits
llvm-commits at lists.llvm.org
Wed Jun 26 11:31:36 PDT 2024
alexey-bataev wrote:
> > Can we have some more tests for other targets too? Would be good to have a test for a target that does not support vectorization of tan
>
> > Can we have some more tests for other targets too? Would be good to have a test for a target that does not support vectorization of tan
>
> The tan llvm inttrinsic was defined in `isTriviallyVectorizable`:
>
> https://github.com/llvm/llvm-project/blob/8ab66775dc885f7a99ee5f53771ce555e42085f9/llvm/lib/Analysis/VectorUtils.cpp#L71
>
> This change is just linking the tan libfuncs to the intrinsic so the libfuncs can also be vectorized. As written there is no backend specific behavior. It is going to vectorize tan across all backends. In other words there doesn't appear to be any way to mark a libfunc or an intrinsic as `isTriviallyVectorizable` for a subset of backends, it is all or nothing. So I don't know how the test case you have asked for makes sense.
Need to be sure that the cost of the vector version is high enough for the targets that do not support it. Otherwise, they may suffer from the perf drop. And still need to add the test, especially codegen (if still not) to be sure that the targets can lower the vector versions correctly.
https://github.com/llvm/llvm-project/pull/95517
More information about the llvm-commits
mailing list