[X86][CostModel] X86TTIImpl::getShuffleCost(): subvector insertions are cheap
authorRoman Lebedev <lebedev.ri@gmail.com>
Mon, 19 Apr 2021 10:23:48 +0000 (13:23 +0300)
committerRoman Lebedev <lebedev.ri@gmail.com>
Mon, 19 Apr 2021 10:24:58 +0000 (13:24 +0300)
commitdf9597cf5a68477058e05028aa91c4eafc4ebcdd
tree186bf339af34c04ed4ad3b2c0f9c6a1d0223328e
parentc9a93c3e0128e3f35620e69d6dad200cd9e37d3c
[X86][CostModel] X86TTIImpl::getShuffleCost(): subvector insertions are cheap

This is similar to the subvector extractions,
except that the 0'th subvector isn't free to insert,
because we generally don't know whether or not
the upper elements need to be preserved:
https://godbolt.org/z/rsxP5W4sW

This is needed to avoid regressions in D100684

Reviewed By: RKSimon

Differential Revision: https://reviews.llvm.org/D100698
llvm/lib/Target/X86/X86TargetTransformInfo.cpp
llvm/test/Analysis/CostModel/X86/masked-intrinsic-cost-inseltpoison.ll
llvm/test/Analysis/CostModel/X86/masked-intrinsic-cost.ll
llvm/test/Transforms/LoopVectorize/X86/gather_scatter.ll