[x86] add cost model special-case for insert/extract from element 0
authorSanjay Patel <spatel@rotateright.com>
Fri, 6 Dec 2019 18:29:31 +0000 (13:29 -0500)
committerSanjay Patel <spatel@rotateright.com>
Fri, 6 Dec 2019 18:50:25 +0000 (13:50 -0500)
commit7ff0fcb53f6e71bc22d37494fdfa68bbf2d3709b
tree84beb1dfd24fc05bc11a0bdc612e3ac6c7cf09b5
parent9a0b5e14075a1f42a72eedb66fd4fde7985d37ac
[x86] add cost model special-case for insert/extract from element 0

This is a follow-up to D70607 where we made any
extract element on SLM more costly than default. But that is
pessimistic for extract from element 0 because that corresponds
to x86 movd/movq instructions. These generally have >1 cycle
latency, but they are probably implemented as single uop
instructions.

Note that no vectorization tests are affected by this change.
Also, no targets besides SLM are affected because those are
falling through to the default cost of 1 anyway. But this will
become visible/important if we add more specializations via cost
tables.

Differential Revision: https://reviews.llvm.org/D71023
llvm/lib/Target/X86/X86TargetTransformInfo.cpp
llvm/test/Analysis/CostModel/X86/fptosi.ll
llvm/test/Analysis/CostModel/X86/fptoui.ll
llvm/test/Analysis/CostModel/X86/shuffle-extract_subvector.ll
llvm/test/Analysis/CostModel/X86/vector-extract.ll