[PATCH] D134719: [AArch64] Enable libm vectorized functions via SLEEF

Paul Walker via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 28 07:40:16 PDT 2022


paulwalker-arm added inline comments.


================
Comment at: clang/lib/CodeGen/BackendUtil.cpp:296
+      case llvm::Triple::aarch64_be:
+        TLII->addVectorizableFunctionsFromVecLib(TargetLibraryInfoImpl::SLEEFGNUABI);
+        break;
----------------
What does `GNUABI` signify? My understanding is the SLEEF functions use the Vector ABI (which is somewhat target neutral?) to construct their name.

Just a thought but to be a bit more target neutral what about splitting `TargetLibraryInfoImpl::SLEEF` based on vector length.  So here we'll have
```
TLII->addVectorizableFunctionsFromVecLib(TargetLibraryInfoImpl::SLEEF_VF2_...)
TLII->addVectorizableFunctionsFromVecLib(TargetLibraryInfoImpl::SLEEF_VF4_...)
```
This way there will be one version of TargetLibraryInfo for SLEEF and different targets can pick and choose based on vectorisation factors.


================
Comment at: clang/lib/Driver/ToolChains/Clang.cpp:5187-5206
+  if (Arg *A = Args.getLastArg(options::OPT_fveclib)) {
+    StringRef Name = A->getValue();
+    if (Name == "SVML") {
+      if (Triple.getArch() != llvm::Triple::x86 &&
+          Triple.getArch() != llvm::Triple::x86_64)
+        D.Diag(diag::err_drv_unsupported_opt_for_target)
+          << Name << Triple.getArchName();
----------------
Do tests exist for these diagnostics? If not can you add them.


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

https://reviews.llvm.org/D134719



More information about the llvm-commits mailing list