[PATCH] D75354: Add InjectTLIMappings pass to new pass manager

Francesco Petrogalli via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 28 11:12:18 PST 2020


fpetrogalli accepted this revision.
fpetrogalli added a comment.
This revision is now accepted and ready to land.

> As @pjeeva01 said, I need to add a test to see if the vectorized function is called in presence of the vector library option.

These tests are already there, those are the tests that use the `-vector-library` option:

  LoopVectorize/X86/svml-calls.ll:; RUN: opt -vector-library=SVML -loop-vectorize -force-vector-width=4 -force-vector-interleave=1 -mattr=avx -S < %s | FileCheck %s
  LoopVectorize/X86/veclib-calls.ll:; RUN: opt < %s -vector-library=Accelerate -loop-vectorize -S | FileCheck %s
  LoopVectorize/X86/TLI-to-vfabi-attribute.ll~:; RUN: opt -vector-library=SVML -loop-vectorize -force-vector-width=4 -force-vector-interleave=1 -mattr=avx -S < %s | FileCheck %s
  LoopVectorize/X86/svml-calls-finite.ll:; RUN: opt -vector-library=SVML -loop-vectorize -S < %s | FileCheck %s
  LoopVectorize/PowerPC/widened-massv-call.ll:; RUN: opt < %s -vector-library=MASSV -force-vector-interleave=1 \
  LoopVectorize/PowerPC/massv-nobuiltin.ll:; RUN: opt -vector-library=MASSV -loop-vectorize -force-vector-interleave=1 -S < %s | FileCheck %s
  LoopVectorize/PowerPC/massv-unsupported.ll:; RUN: opt -vector-library=MASSV -loop-vectorize -force-vector-interleave=1 -S < %s | FileCheck %s
  LoopVectorize/PowerPC/massv-altivec.ll:; RUN: opt -vector-library=MASSV -loop-vectorize -force-vector-interleave=1 -mattr=-altivec -S < %s | FileCheck %s
  LoopVectorize/PowerPC/massv-calls.ll:; RUN: opt -vector-library=MASSV -loop-vectorize -force-vector-interleave=1 -S < %s | FileCheck %s

As the tests are showing, we already know that the library calls are inserted when vectorizing: InjectTLIMappings is adding the attribute `vector-function-abi-variant` to the call sites, and the LoopVectorizer is using it for vectorization.

What is missing in this picture (LoopVectorize with `vector-function-abi-variant` attribute) are the test that make sure vectorization happens when `-vector-library` is not used and only the attribute is present. That deserves a separate patch that is on my todo list. Of course, anyone is _very_ welcome to come up with a patch, which I happily review! :)

Thank you, this LGTM now.


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

https://reviews.llvm.org/D75354





More information about the llvm-commits mailing list