[PATCH] D89767: [CostModel][X86] teach TTI calculate cost of chain of vector inserts/extracts more precisely and correctly:In each 128-lane, if there is at least one index is demanded and not allindices are demanded and this 128-lane is not the first 128-lane...

Bing Yu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 19 23:32:27 PDT 2020


yubing created this revision.
Herald added subscribers: llvm-commits, arphaman, hiraditya.
Herald added a project: LLVM.
yubing requested review of this revision.

...of the
legalized-vector, then this 128-lane needs a extracti128;
If in each 128-lane, there is at least one index is demanded, this 128-lane
needs a inserti128.

The following cases will help you build a better understanding:
Assume we insert several elements into a v8i32 vector in avx2,
Case#1: inserting into 1th index needs vpinsrd + inserti128
Case#2: inserting into 5th index needs extracti128 + vpinsrd +
inserti128
Case#3: inserting into 4,5,6,7 index needs 4*vpinsrd + inserti128.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D89767

Files:
  llvm/lib/Target/X86/X86TargetTransformInfo.cpp
  llvm/test/Analysis/CostModel/X86/arith-fp.ll
  llvm/test/Analysis/CostModel/X86/fptosi.ll
  llvm/test/Analysis/CostModel/X86/fptoui.ll
  llvm/test/Analysis/CostModel/X86/load_store.ll
  llvm/test/Analysis/CostModel/X86/masked-intrinsic-cost.ll
  llvm/test/Analysis/CostModel/X86/sitofp.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D89767.299269.patch
Type: text/x-patch
Size: 36338 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201020/cc8043a3/attachment.bin>


More information about the llvm-commits mailing list