[all-commits] [llvm/llvm-project] 2c08f1: [CostModel][X86] teach TTI calculate cost of chain...

yubingex007-a11y via All-commits all-commits at lists.llvm.org
Mon Oct 26 20:21:45 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 2c08f1b4b69e1953044abdcdf06f78613e01cc8c
      https://github.com/llvm/llvm-project/commit/2c08f1b4b69e1953044abdcdf06f78613e01cc8c
  Author: Bing1 Yu <bing1.yu at intel.com>
  Date:   2020-10-27 (Tue, 27 Oct 2020)

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

  Log Message:
  -----------
  [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 all indices are demanded...

In each 128-lane, if there is at least one index is demanded and not all
indices are demanded and this 128-lane is not the first 128-lane 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.

Reviewed By: pengfei, RKSimon

Differential Revision: https://reviews.llvm.org/D89767




More information about the All-commits mailing list