[X86][SSE] Use multiplication scale factors for v8i16 SHL on pre-AVX2 targets.
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Tue, 5 Jun 2018 15:17:39 +0000 (15:17 +0000)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Tue, 5 Jun 2018 15:17:39 +0000 (15:17 +0000)
commitf2f043acbb90df04e0548040eb3044b89279ee18
tree1d0369a740dee1e6b8e0e4880d94a4502f52d422
parent05b589101e7dadce267881e5b0832882f95a9908
[X86][SSE] Use multiplication scale factors for v8i16 SHL on pre-AVX2 targets.

Similar to v4i32 SHL, convert v8i16 shift amounts to scale factors instead to improve performance and reduce instruction count. We were already doing this for constant shifts, this adds variable shift support.

Reduces the serial nature of the codegen, which relies on chains of plendvb/pand+pandn+por shifts.

This is a step towards adding support for vXi16 vector rotates.

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

llvm-svn: 334023
llvm/lib/Target/X86/X86ISelLowering.cpp
llvm/test/Analysis/CostModel/X86/testshiftshl.ll
llvm/test/CodeGen/X86/vector-rotate-128.ll
llvm/test/CodeGen/X86/vector-rotate-256.ll
llvm/test/CodeGen/X86/vector-shift-shl-128.ll
llvm/test/CodeGen/X86/vector-shift-shl-256.ll