[PATCH] D92701: [SLPVectorize] Call isLegalMaskedGather before creating a gather TreeEntry

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Dec 5 02:42:14 PST 2020


fhahn added a comment.

I think using `isLegalMaskedGather` is a workaround for a cost-model deficiencies. If the cost-model accurately estimates the cost of masked gathers & scatters, they would not be selected by the SLP vectorizer. I think it would be preferable to improve the cost modeling for gathers/scatters on X86 and remove the workaround in LoopVectorize as well. I recently added an initial estimate for gather & scatter costs to BasicTTI (D91984 <https://reviews.llvm.org/D91984>) and this resolved similar issues on AArch64. Would it be possible to adjust  `X86TTIImpl::getGatherScatterOpCost` to more accurately estimate the cost, maybe by falling back to BasicTTI in cases not handled there yet?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D92701



More information about the llvm-commits mailing list