[PATCH] D53035: [LV] Legalize SVML call instructions during vector code generation

Karthik Senthil via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 17 17:13:20 PDT 2020


karthiksenthil added inline comments.


================
Comment at: llvm/lib/Transforms/Vectorize/LoopVectorize.cpp:4702
+      // was not Intrinsic
+      if (!isa<IntrinsicInst>(CI) &&
+          (V->getCalledFunction()->getName()).startswith("__svml")) {
----------------
ayermolo wrote:
> For my own education, how come there is a check for intrinsic? Won't something like log(..) be treated as intrinsic?
This check is added to restrict the legalization feature to scalar math library calls that are translated to SVML calls upon vectorization. It does not work for standard C/C++ library intrinsics like `llvm.sin.*` or `llvm.log*`. Note that these intrinsics are also mapped to SVML variants in `llvm/include/llvm/Analysis/VecFuncs.def`. The relevant new LIT test in this patch that verifies this restriction is `llvm/test/Transforms/LoopVectorize/X86/svml-legal-calls.ll`.


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

https://reviews.llvm.org/D53035



More information about the llvm-commits mailing list