[all-commits] [llvm/llvm-project] 0116c7: [X86][Costmodel] `trunc v16i32 to v32i8/v64i8` can...

Roman Lebedev via All-commits all-commits at lists.llvm.org
Mon Nov 15 08:04:34 PST 2021


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

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

  Log Message:
  -----------
  [X86][Costmodel] `trunc v16i32 to v32i8/v64i8` can appear after legalization, cost is same as for `trunc v16i32 to v16i8`

While this one is trivial and identical to the previous patch,
there is a weird cost change in a follow-up patch that i'm not sure about.

Reviewed By: RKSimon

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


  Commit: 9e57d9b09deaa9454c5c081acd68b76ba8ac76bf
      https://github.com/llvm/llvm-project/commit/9e57d9b09deaa9454c5c081acd68b76ba8ac76bf
  Author: Roman Lebedev <lebedev.ri at gmail.com>
  Date:   2021-11-15 (Mon, 15 Nov 2021)

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

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

While this one is trivial and identical to the previous patch,
there is a weird cost change in a follow-up patch that i'm not sure about.

Reviewed By: RKSimon

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


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

  Changed paths:
    M llvm/lib/Target/X86/X86TargetTransformInfo.cpp
    M llvm/test/Analysis/CostModel/X86/arith-fix.ll
    M llvm/test/Analysis/CostModel/X86/arith-overflow.ll
    M llvm/test/Analysis/CostModel/X86/arith.ll
    M llvm/test/Analysis/CostModel/X86/mul.ll
    M llvm/test/Analysis/CostModel/X86/rem.ll
    M llvm/test/Analysis/CostModel/X86/trunc.ll

  Log Message:
  -----------
  [X86][Costmodel] `trunc v32i16 to v64i8` can appear after legalization, cost is same as for `trunc v32i16 to v32i8`

Some of the costs get larger here,
but i suppose that makes sense since we'd previously query
scalarization costs that may not be really representative of the reality.

Reviewed By: RKSimon

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


  Commit: 5c7255fe3a8570a329d894c22421b54a5e5d5dc7
      https://github.com/llvm/llvm-project/commit/5c7255fe3a8570a329d894c22421b54a5e5d5dc7
  Author: Roman Lebedev <lebedev.ri at gmail.com>
  Date:   2021-11-15 (Mon, 15 Nov 2021)

  Changed paths:
    M llvm/lib/Target/X86/X86TargetTransformInfo.cpp
    M llvm/test/Analysis/CostModel/X86/interleaved-store-accesses-with-gaps.ll
    M llvm/test/Analysis/CostModel/X86/shuffle-replication-i8.ll

  Log Message:
  -----------
  [X86][Costmodel] `getReplicationShuffleCost()`: promote 8 bit-wide elements to 32 bit when no AVX512VBMI

Currently `X86TTIImpl::getInterleavedMemoryOpCostAVX512()` asks about i8 elt type,
so this change does affect vectorization. In the end, it will ask about i1.

We should also try to promote to i16 if we have AVX512BW, i'll do that in a follow-up.
All costs here look good, i've added the missing truncation costs in preparatory patches.

Reviewed By: RKSimon

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


Compare: https://github.com/llvm/llvm-project/compare/49c08a22edc3...5c7255fe3a85


More information about the All-commits mailing list