From 057100dd3a91d977bfc4211eee37b0175429e5c8 Mon Sep 17 00:00:00 2001 From: Simon Pilgrim Date: Tue, 6 Dec 2016 17:00:47 +0000 Subject: [PATCH] [X86][SSE] Add knownbits test demonstrating demandedelts not ignoring undef shuffle elements git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288825 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/CodeGen/X86/known-bits-vector.ll | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/test/CodeGen/X86/known-bits-vector.ll b/test/CodeGen/X86/known-bits-vector.ll index 872890e76d7..e5e4fcf8338 100644 --- a/test/CodeGen/X86/known-bits-vector.ll +++ b/test/CodeGen/X86/known-bits-vector.ll @@ -70,6 +70,27 @@ define <4 x i32> @knownbits_mask_shuffle_sext(<8 x i16> %a0) nounwind { ret <4 x i32> %3 } +define <4 x i32> @knownbits_mask_shuffle_shuffle_sext(<8 x i16> %a0) nounwind { +; X32-LABEL: knownbits_mask_shuffle_shuffle_sext: +; X32: # BB#0: +; X32-NEXT: vpand {{\.LCPI.*}}, %xmm0, %xmm0 +; X32-NEXT: vpshufd {{.*#+}} xmm0 = xmm0[2,3,0,1] +; X32-NEXT: vpmovsxwd %xmm0, %xmm0 +; X32-NEXT: retl +; +; X64-LABEL: knownbits_mask_shuffle_shuffle_sext: +; X64: # BB#0: +; X64-NEXT: vpand {{.*}}(%rip), %xmm0, %xmm0 +; X64-NEXT: vpshufd {{.*#+}} xmm0 = xmm0[2,3,0,1] +; X64-NEXT: vpmovsxwd %xmm0, %xmm0 +; X64-NEXT: retq + %1 = and <8 x i16> %a0, + %2 = shufflevector <8 x i16> %1, <8 x i16> undef, <8 x i32> + %3 = shufflevector <8 x i16> %2, <8 x i16> undef, <4 x i32> + %4 = sext <4 x i16> %3 to <4 x i32> + ret <4 x i32> %4 +} + define <4 x float> @knownbits_mask_shuffle_uitofp(<4 x i32> %a0) nounwind { ; X32-LABEL: knownbits_mask_shuffle_uitofp: ; X32: # BB#0: