diff options
| author | Simon Pilgrim <llvm-dev@redking.me.uk> | 2016-03-10 11:50:15 +0000 |
|---|---|---|
| committer | Simon Pilgrim <llvm-dev@redking.me.uk> | 2016-03-10 11:50:15 +0000 |
| commit | 13d4056795e83423366089ae9df8b1b6659b84fe (patch) | |
| tree | 3070e2b37f7aae7ccdacc0c111fa88def7282763 | |
| parent | 4c660f70870023d62e5fd353c7038359fd23391e (diff) | |
| download | bcm5719-llvm-13d4056795e83423366089ae9df8b1b6659b84fe.tar.gz bcm5719-llvm-13d4056795e83423366089ae9df8b1b6659b84fe.zip | |
[X86][AVX] Improve target shuffle combining of BLEND+zero
The BLEND+zero combine was failing to combine equivalent BLEND masks.
Follow up to D17483 and D17858
llvm-svn: 263105
| -rw-r--r-- | llvm/lib/Target/X86/X86ISelLowering.cpp | 3 | ||||
| -rw-r--r-- | llvm/test/CodeGen/X86/vector-shuffle-128-v2.ll | 8 |
2 files changed, 4 insertions, 7 deletions
diff --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp index 3ae5136fe90..214f20b1951 100644 --- a/llvm/lib/Target/X86/X86ISelLowering.cpp +++ b/llvm/lib/Target/X86/X86ISelLowering.cpp @@ -23916,7 +23916,8 @@ static bool combineX86ShuffleChain(SDValue Input, SDValue Root, if (Mask[i / MaskRatio] < 0) BlendMask |= 1u << i; - if (Root.getOpcode() != X86ISD::BLENDI || + if (Depth != 1 || RootVT != ShuffleVT || + Root.getOpcode() != X86ISD::BLENDI || Root->getConstantOperandVal(2) != BlendMask) { SDValue Zero = getZeroVector(ShuffleVT, Subtarget, DAG, DL); Res = DAG.getBitcast(ShuffleVT, Input); diff --git a/llvm/test/CodeGen/X86/vector-shuffle-128-v2.ll b/llvm/test/CodeGen/X86/vector-shuffle-128-v2.ll index 03973661ce0..d1d4f72da1e 100644 --- a/llvm/test/CodeGen/X86/vector-shuffle-128-v2.ll +++ b/llvm/test/CodeGen/X86/vector-shuffle-128-v2.ll @@ -941,17 +941,13 @@ define <2 x i64> @shuffle_v2i64_bitcast_z123(<2 x i64> %x) { ; ; AVX2-LABEL: shuffle_v2i64_bitcast_z123: ; AVX2: # BB#0: -; AVX2-NEXT: vmovss {{.*#+}} xmm1 = mem[0],zero,zero,zero -; AVX2-NEXT: vblendps {{.*#+}} xmm0 = xmm1[0],xmm0[1,2,3] -; AVX2-NEXT: vxorps %xmm1, %xmm1, %xmm1 +; AVX2-NEXT: vpxor %xmm1, %xmm1, %xmm1 ; AVX2-NEXT: vpblendd {{.*#+}} xmm0 = xmm1[0],xmm0[1,2,3] ; AVX2-NEXT: retq ; ; AVX512VL-LABEL: shuffle_v2i64_bitcast_z123: ; AVX512VL: # BB#0: -; AVX512VL-NEXT: vmovss {{.*#+}} xmm1 = mem[0],zero,zero,zero -; AVX512VL-NEXT: vblendps {{.*#+}} xmm0 = xmm1[0],xmm0[1,2,3] -; AVX512VL-NEXT: vxorps %xmm1, %xmm1, %xmm1 +; AVX512VL-NEXT: vpxor %xmm1, %xmm1, %xmm1 ; AVX512VL-NEXT: vpblendd {{.*#+}} xmm0 = xmm1[0],xmm0[1,2,3] ; AVX512VL-NEXT: retq %bitcast32 = bitcast <2 x i64> %x to <4 x float> |

