[PATCH] D77925: Revert "[TLI] Per-function fveclib for math library used for vectorization"

Wenlei He via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat Aug 15 21:50:04 PDT 2020


wenlei added a comment.

In D77925#2016326 <https://reviews.llvm.org/D77925#2016326>, @tejohnson wrote:

> In D77925#2016299 <https://reviews.llvm.org/D77925#2016299>, @wenlei wrote:
>
>> @mehdi_amini @tejohnson When can we re-land this (with tweaks)? I'm under the impression that a test case demonstrating the 3rd party usage will be added very soon after this revert, then we can tweak the original patch to accommodate that usage, and re-land asap. Or am I missing something there? I'd like to get this unblocked asap. Currently we have to keep this as a private patch on our end which is a bit cumbersome, and I think this one can be useful for others too. Thanks..
>
> @bkramer can you work with Wenlei on this (original patch is D77632 <https://reviews.llvm.org/D77632>).
>
> @wenlei, in the meantime you can see the use case here:
> https://github.com/tensorflow/tensorflow/blob/master/tensorflow/compiler/xla/service/cpu/compiler_functor.cc#L198
> for revising the patch.

Thanks for pointer, @tejohnson. Looks like we need a way for others to provide a set of vector functions. How about we introduced a dedicated VecLib type `Custom`, in addition to the existing ones (Accelerate, SVML and MASSV), and expose a public API `addCustomVectorizableFunctions(ArrayRef<VecDesc> Fns)` for TLII to allow registering custom function list. This way we preserve the openness through `Custom`, but also keep it clean and structured.

Then for XLA, you just need to specify `-fveclib=Custom` and call `addCustomVectorizableFunctions` instead of `addVectorizableFunctions`.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D77925



More information about the cfe-commits mailing list