[CostModel][X86] Add CostKinds handling for vector shift by uniform/constuniform ops
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Thu, 15 Sep 2022 13:01:27 +0000 (14:01 +0100)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Thu, 15 Sep 2022 13:05:30 +0000 (14:05 +0100)
commit0ec028fe105b9bcdda4196cc8803205a1577c12a
tree8a8a6e07ba8d3b2853113a0ced207b8173bc3621
parent8f19de848b968bfdd237bdb6ffb65e7412bb6a0c
[CostModel][X86] Add CostKinds handling for vector shift by uniform/constuniform ops

Vector shift by const uniform is the cheapest shift instruction we have, non-const uniform have a marginally higher cost - some targets 'splat' the amount internally to use the shift-per-element instruction, others see a higher cost for the explicit zeroing of the upper bits for the (64-bit) shift amount.

This was achieved with an updated version of the 'cost-tables vs llvm-mca' script D103695 (I'll update the patch soon for reference)
33 files changed:
llvm/lib/Target/X86/X86TargetTransformInfo.cpp
llvm/test/Analysis/CostModel/X86/arith-fix.ll
llvm/test/Analysis/CostModel/X86/arith-overflow.ll
llvm/test/Analysis/CostModel/X86/div-codesize.ll
llvm/test/Analysis/CostModel/X86/div-latency.ll
llvm/test/Analysis/CostModel/X86/div-sizelatency.ll
llvm/test/Analysis/CostModel/X86/div.ll
llvm/test/Analysis/CostModel/X86/fshl.ll
llvm/test/Analysis/CostModel/X86/fshr.ll
llvm/test/Analysis/CostModel/X86/intrinsic-cost-kinds.ll
llvm/test/Analysis/CostModel/X86/mul.ll
llvm/test/Analysis/CostModel/X86/rem-codesize.ll
llvm/test/Analysis/CostModel/X86/rem-latency.ll
llvm/test/Analysis/CostModel/X86/rem-sizelatency.ll
llvm/test/Analysis/CostModel/X86/rem.ll
llvm/test/Analysis/CostModel/X86/uniformshift-inseltpoison.ll
llvm/test/Analysis/CostModel/X86/uniformshift.ll
llvm/test/Analysis/CostModel/X86/vshift-ashr-codesize.ll
llvm/test/Analysis/CostModel/X86/vshift-ashr-cost-inseltpoison.ll
llvm/test/Analysis/CostModel/X86/vshift-ashr-cost.ll
llvm/test/Analysis/CostModel/X86/vshift-ashr-latency.ll
llvm/test/Analysis/CostModel/X86/vshift-ashr-sizelatency.ll
llvm/test/Analysis/CostModel/X86/vshift-lshr-codesize.ll
llvm/test/Analysis/CostModel/X86/vshift-lshr-cost-inseltpoison.ll
llvm/test/Analysis/CostModel/X86/vshift-lshr-cost.ll
llvm/test/Analysis/CostModel/X86/vshift-lshr-latency.ll
llvm/test/Analysis/CostModel/X86/vshift-lshr-sizelatency.ll
llvm/test/Analysis/CostModel/X86/vshift-shl-codesize.ll
llvm/test/Analysis/CostModel/X86/vshift-shl-cost-inseltpoison.ll
llvm/test/Analysis/CostModel/X86/vshift-shl-cost.ll
llvm/test/Analysis/CostModel/X86/vshift-shl-latency.ll
llvm/test/Analysis/CostModel/X86/vshift-shl-sizelatency.ll
llvm/test/Transforms/LoopVectorize/X86/uniformshift.ll