[PATCH] D115329: [LoopVectorize] Pass a vector type to isLegalMaskedGather/Scatter

Sander de Smalen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 14 05:25:31 PST 2021


sdesmalen added a comment.

In D115329#3189241 <https://reviews.llvm.org/D115329#3189241>, @lebedev.ri wrote:

> In D115329#3189215 <https://reviews.llvm.org/D115329#3189215>, @sdesmalen wrote:
>
>>> From that perspective, saying that <operation> is legal, means it will not need to be scalarized.
>
> Define "need".
> It is not much different from what VectorCombine does ("would scalar cost be lower than vector cost?
> if so, scalarize" or the other way around), just implemented in an another pass.

I see your point, it just seemed odd to me that for X86 this required reimplementing a different scalarisation cost rather than relying on the mechanisms already present in LoopVectorize, which tries to cost as accurately as possible whether to scalarize or use the intrinsics.
To me that suggests that the scalarization cost in LoopVectorize is inaccurate or there's improvements to be made to the code for scalarizing in the LoopVectorizer (or both) to make sure there is no disparity in performance.

As you explained, it's currently doing the right thing in the sense that it leads to the desired result.


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

https://reviews.llvm.org/D115329



More information about the llvm-commits mailing list