[all-commits] [llvm/llvm-project] e87669: [NFC][TTI] `getReplicationShuffleCost()`: s/Replic...

Roman Lebedev via All-commits all-commits at lists.llvm.org
Sun Nov 14 09:02:11 PST 2021


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

  Changed paths:
    M llvm/include/llvm/Analysis/TargetTransformInfo.h
    M llvm/include/llvm/Analysis/TargetTransformInfoImpl.h
    M llvm/include/llvm/CodeGen/BasicTTIImpl.h
    M llvm/lib/Analysis/TargetTransformInfo.cpp
    M llvm/lib/Target/X86/X86TargetTransformInfo.cpp
    M llvm/lib/Target/X86/X86TargetTransformInfo.h

  Log Message:
  -----------
  [NFC][TTI] `getReplicationShuffleCost()`: s/Replicated/Dst/

'Replicated' is mouthful and somewhat ambigious,
while 'destination' is pretty self-explanatory.


  Commit: 4dd2f0446cf5de76c16a2663049a874f5c90ac92
      https://github.com/llvm/llvm-project/commit/4dd2f0446cf5de76c16a2663049a874f5c90ac92
  Author: Roman Lebedev <lebedev.ri at gmail.com>
  Date:   2021-11-14 (Sun, 14 Nov 2021)

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

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

The basic idea is simple, if we don't have native shuffle for this element type,
then we must have native shuffle for wider element type,
so promote, replicate, demote.

I believe, asking `getCastInstrCost(Instruction::Trunc` is correct semantically,
case in point `trunc <32 x i32> to <32 x i8>` aka 2 * ZMM will naively result in
2 * XMM, that then will be packed into 1 * YMM,
and it should count the cost of said packing,
not just the truncations.

Reviewed By: RKSimon

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


Compare: https://github.com/llvm/llvm-project/compare/b69dc2d18042...4dd2f0446cf5


More information about the All-commits mailing list