llvm/test/CodeGen
Andrea Di Biagio 749e8fee34 [X86] Improve the lowering of packed shifts by constant build_vector.
This patch teaches the backend how to efficiently lower logical and
arithmetic packed shifts on both SSE and AVX/AVX2 machines.

When possible, instead of scalarizing a vector shift, the backend should try
to expand the shift into a sequence of two packed shifts by immedate count
followed by a MOVSS/MOVSD.

Example
  (v4i32 (srl A, (build_vector < X, Y, Y, Y>)))

Can be rewritten as:
  (v4i32 (MOVSS (srl A, <Y,Y,Y,Y>), (srl A, <X,X,X,X>)))

[with X and Y ConstantInt]

The advantage is that the two new shifts from the example would be lowered into
X86ISD::VSRLI nodes. This is always cheaper than scalarizing the vector into
four scalar shifts plus four pairs of vector insert/extract.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206316 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-15 19:30:48 +00:00
..
AArch64 [ARM64] Set default CPU to generic instead of cyclone. 2014-04-15 19:08:46 +00:00
ARM Fix a bug in which BranchProbabilityInfo wasn't setting branch weights of basic blocks inside loops correctly. 2014-04-14 16:56:19 +00:00
ARM64 [ARM64] Set default CPU to generic instead of cyclone. 2014-04-15 19:08:46 +00:00
CPP
Generic CommandLine: Exit successfully for -version and -help 2014-02-28 19:08:01 +00:00
Hexagon Fix broken CHECK lines 2014-02-16 07:31:05 +00:00
Inputs
Mips [mips] Fix fcopysign for MIPS-IV and add the test. 2014-04-14 16:24:12 +00:00
MSP430 Mark FPB as a reserved register when needed. 2014-04-02 13:13:56 +00:00
NVPTX [NVPTX] Add preliminary intrinsics and codegen support for textures/surfaces 2014-04-09 15:39:15 +00:00
PowerPC [PowerPC] Fix rlwimi isel when mask is not constant 2014-04-13 17:10:58 +00:00
R600 SelectionDAG: Use helper function to improve legalization of ISD::MUL 2014-04-11 16:12:01 +00:00
SPARC Remove the linker_private and linker_private_weak linkages. 2014-03-13 23:18:37 +00:00
SystemZ Reenable use of TBAA during CodeGen 2014-04-12 01:26:00 +00:00
Thumb Move the segmented stack switch to a function attribute 2014-04-10 22:58:43 +00:00
Thumb2 Move the segmented stack switch to a function attribute 2014-04-10 22:58:43 +00:00
X86 [X86] Improve the lowering of packed shifts by constant build_vector. 2014-04-15 19:30:48 +00:00
XCore [XCore] Don't create invalid MKMSK instructions inside loadImmediate(). 2014-04-14 12:30:35 +00:00