[PATCH] D88154: Initial support for vectorization using Libmvec (GLIBC vector math library).

Nemanja Ivanovic via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 8 03:54:37 PDT 2020


nemanjai added inline comments.


================
Comment at: llvm/include/llvm/Analysis/TargetLibraryInfo.h:91
     Accelerate, // Use Accelerate framework.
+    LIBMVEC,    // GLIBC Vector Math library.
     MASSV,      // IBM MASS vector library.
----------------
fpetrogalli wrote:
> Can we call this LIBMVEC-X86? Libmvec itself is supposed to support other architectures, I can see list of mappings for each of the supported targets.
> 
> Then, the logic of selecting the correct one in the frontent clang would depend on the value of `-fvec-lib=libmvec` plus the value of `-target`.
So if I follow correctly, we can choose the various vendor-specific libraries as well as `libmvec` which itself has target-specific ports.

Would it make sense to just add an overload of `addVectorizableFunctions()` that would consider the `Triple` and remove any entries from `VectorDescs` that the target doesn't support? Or even more specifically, simply add the `Triple` argument to `addVectorizableFunctionsFromVecLib()` and call something like `removeLIBMVECEntriesForTarget(const Triple &T)` that would do the job.

And of course, if the triple isn't provided and the user is targeting an architecture that doesn't provide some entry, that is just user error.


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

https://reviews.llvm.org/D88154



More information about the llvm-commits mailing list