[PATCH] D111222: [X86][Costmodel] Fix `X86TTIImpl::getGSScalarCost()`

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 6 05:55:15 PDT 2021


lebedev.ri created this revision.
lebedev.ri added reviewers: RKSimon, delena, efriedma.
lebedev.ri added a project: LLVM.
Herald added subscribers: pengfei, arphaman, hiraditya.
lebedev.ri requested review of this revision.

`X86TTIImpl::getGSScalarCost()` has (at least) two issues:

- it naively computes the cost of sequence of `insertelement`/`extractelement`. If we are operating not on the XMM (but high half of YMM), this widely overestimates the cost of subvector insertions/extractions.
- Gather/scatter takes a vector of pointers, and scalarization results in us performing scalar memory operation for each of these pointers, but we never account for the cost of extracting these pointers out of the vector of pointers.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D111222

Files:
  llvm/lib/Target/X86/X86TargetTransformInfo.cpp
  llvm/test/Analysis/CostModel/X86/gather-i32-with-i8-index.ll
  llvm/test/Analysis/CostModel/X86/gather-i64-with-i8-index.ll
  llvm/test/Analysis/CostModel/X86/intrinsic-cost-kinds.ll
  llvm/test/Analysis/CostModel/X86/masked-gather-i32-with-i8-index.ll
  llvm/test/Analysis/CostModel/X86/masked-intrinsic-cost-inseltpoison.ll
  llvm/test/Analysis/CostModel/X86/masked-intrinsic-cost.ll
  llvm/test/Analysis/CostModel/X86/masked-scatter-i32-with-i8-index.ll
  llvm/test/Analysis/CostModel/X86/scatter-i32-with-i8-index.ll
  llvm/test/Analysis/CostModel/X86/scatter-i64-with-i8-index.ll
  llvm/test/Transforms/LoopVectorize/X86/gather_scatter.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D111222.377513.patch
Type: text/x-patch
Size: 346288 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211006/d5bebff2/attachment-0001.bin>


More information about the llvm-commits mailing list