[PATCH] D101297: [SLP]Allow masked gathers only if allowed by target.

Alexey Bataev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 4 04:18:16 PDT 2021


ABataev added a comment.

In D101297#2735772 <https://reviews.llvm.org/D101297#2735772>, @uabelho wrote:

> In D101297#2735721 <https://reviews.llvm.org/D101297#2735721>, @uabelho wrote:
>
>> I'm seeing a strange case with this patch where I now get calls to
>>
>>   llvm.masked.gather.v2i16.v2p0i16
>>
>> after SLP vectorizer and before we didn't?
>> Masked gather is not legal on my target. Something seems to be backwards?
>
> In my case the cost as computed by TTI->getGatherScatterOpCost (so the cost prior to this patch) is 6 but calculated in the new way (since masked gather is not legal) I get the cost 0. getGatherCost(VL) returns 2 and then getEntryCost(It->get()) 2 as well so VecLdCost now ends up as 0.

If the masked gather is not legal, it should be converted to a regular gather by `scalarizeMaskedGather` function (called by `ScalarizeMaskedMemIntrinLegacyPass::runOnFunction`), that's why we calculate it as a regular gather


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D101297



More information about the llvm-commits mailing list