This patch optimizes shuffle instruction - generates 2 instructions instead of 4.
authorElena Demikhovsky <elena.demikhovsky@intel.com>
Tue, 4 Sep 2012 12:49:02 +0000 (12:49 +0000)
committerElena Demikhovsky <elena.demikhovsky@intel.com>
Tue, 4 Sep 2012 12:49:02 +0000 (12:49 +0000)
commit32510207382720a97c682e098d45cb1371c48639
tree6d5f6007ba1667333625c3d331851a160cf3be10
parent7765492a7a7e6eab36bc43558ea7c1f91e57cfec
This patch optimizes shuffle instruction - generates 2 instructions instead of 4.
Since this specific shuffle is widely used in many workloads we have ~10% performance on them.

shufflevector <8 x float> %A, <8 x float> %B, <8 x i32> <i32 0, i32 8, i32 2, i32 10, i32 4, i32 12, i32 6, i32 14>

vmovaps (%rdx), %ymm0
vshufps $8, %ymm0, %ymm0, %ymm0
vmovaps (%rcx), %ymm1
vshufps $8, %ymm0, %ymm1, %ymm1
vunpcklps       %ymm0, %ymm1, %ymm0

vmovaps (%rcx), %ymm0
vmovsldup       (%rdx), %ymm1
vblendps        $85, %ymm0, %ymm1, %ymm0

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163134 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/X86/X86ISelLowering.cpp
test/CodeGen/X86/avx-shuffle.ll