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

Rosie Sumpter via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 15 08:35:07 PST 2021


RosieSumpter added a comment.

Hi @lebedev.ri, the SLPVectorizer/X86/pr47629 tests have changed because `isLegalMaskedGather` now returns true for certain cases where it didn't before (due to the check on the number of vector elements now being in `forceScalarizeMaskedGather` as requested). It then calculates the gather/scatter cost, and because `forceScalarizeMaskedGather` returns true, it calculates the cost using `getGSScalarCost`. This cost is higher than before and so it chooses not to vectorize. An alternative approach would be to check `forceScalarizeMaskedGather` in `isLegalMaskedGather` instead of when calculating the cost, but this will then mean LoopVectorize will assume these operations need to be scalarized so will cause test failures there. What do you think the preferred option is here?


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

https://reviews.llvm.org/D115329



More information about the llvm-commits mailing list