[PATCH] D67572: [VectorUtils] Introduce the Vector Function Database (VFDatabase).

Francesco Petrogalli via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 12 07:45:31 PST 2019


fpetrogalli added a comment.

In D67572#1781286 <https://reviews.llvm.org/D67572#1781286>, @uabelho wrote:

> ...
>
> This meant that before this patch
>
>   LoopVectorizationLegality::canVectorizeInstrs()
>
>
> accepted to vectorize the loop since
>
>   TLI->isFunctionVectorizable(CI->getCalledFunction()->getName())
>   
>
> returned true for the intrinsic.
>
> Then in LoopVectorizationCostModel::getVectorCallCost we decided that the call to the intrinsic should be scalarized, since
>
>   TLI->isFunctionVectorizable(FnName, VF)
>   
>
> returned false.


Ah, OK. I see what you mean. I think we could solve this by scalarizing after vectorization, instead of doing it in the vectorizer.

We could have a IR pass that runs after the vectorizer that looks for intrinsics calls .When it sees an intrinsics that operates on vector, it checks whether the target is able to lower it to some function or instruction. If not, it scalarizes it. With this we wouldn't have to introduce special behavior in the vectorizer for handling intrinsics: it could just vectorize any call to intrinsics for which vectorization make sense.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D67572





More information about the llvm-commits mailing list