[all-commits] [llvm/llvm-project] a50fdd: [X86][Costmodel] `getReplicationShuffleCost()`: pr...

Roman Lebedev via All-commits all-commits at lists.llvm.org
Fri Nov 19 05:01:27 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: a50fdd3fc9827cf3b3a177d72ada6c5f9298522b
      https://github.com/llvm/llvm-project/commit/a50fdd3fc9827cf3b3a177d72ada6c5f9298522b
  Author: Roman Lebedev <lebedev.ri at gmail.com>
  Date:   2021-11-19 (Fri, 19 Nov 2021)

  Changed paths:
    M llvm/lib/Target/X86/X86TargetTransformInfo.cpp
    M llvm/test/Analysis/CostModel/X86/shuffle-replication-i1.ll

  Log Message:
  -----------
  [X86][Costmodel] `getReplicationShuffleCost()`: promote 1 bit-wide elements to 16 bit when have AVX512BW

Here we get pretty lucky. AVX512F does not provide any instructions
to convert between a `k` vector mask and a vector,
but AVX512BW adds `{k}<->nX{i8,i16}`conversions,
and just as it happens, with AVX512BW we have a i16 shuffle.

Reviewed By: RKSimon

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


  Commit: a751084bb4521f0847f39e9eb564e225ccce311e
      https://github.com/llvm/llvm-project/commit/a751084bb4521f0847f39e9eb564e225ccce311e
  Author: Roman Lebedev <lebedev.ri at gmail.com>
  Date:   2021-11-19 (Fri, 19 Nov 2021)

  Changed paths:
    M llvm/lib/Target/X86/X86TargetTransformInfo.cpp
    M llvm/test/Analysis/CostModel/X86/trunc.ll

  Log Message:
  -----------
  [X86][Costmodel] `trunc v16i8 to v8i1` can appear after legalization, cost is same as for `trunc v8i8 to v8i1`

Note that there are many other missing costs, i'm *only* adding the ones that are queried
from `getReplicationShuffleCost()` for the existing (quite exhaustive) test coverage.

Reviewed By: RKSimon

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


  Commit: 049799c311515c8c8b5daf91b4a731870ed54afe
      https://github.com/llvm/llvm-project/commit/049799c311515c8c8b5daf91b4a731870ed54afe
  Author: Roman Lebedev <lebedev.ri at gmail.com>
  Date:   2021-11-19 (Fri, 19 Nov 2021)

  Changed paths:
    M llvm/lib/Target/X86/X86TargetTransformInfo.cpp
    M llvm/test/Analysis/CostModel/X86/shuffle-replication-i1.ll

  Log Message:
  -----------
  [X86][Costmodel] `getReplicationShuffleCost()`: promote 1 bit-wide elements to 8 bit when have AVX512BW+AVX512VBMI

If in addition to AVX512BW (that provides `{k}<->{i8,i16}` casts and i16 shuffles),
we have AVX512VBMI, which provides i8 shuffles, we are in an optimal situation.

Reviewed By: RKSimon

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


Compare: https://github.com/llvm/llvm-project/compare/92d279fd6d1f...049799c31151


More information about the All-commits mailing list