diff --git a/llvm/test/CodeGen/X86/vector-shuffle-512-v32.ll b/llvm/test/CodeGen/X86/vector-shuffle-512-v32.ll index 26cd7301fe60..8984c237e545 100644 --- a/llvm/test/CodeGen/X86/vector-shuffle-512-v32.ll +++ b/llvm/test/CodeGen/X86/vector-shuffle-512-v32.ll @@ -188,3 +188,30 @@ define <32 x i16> @shuffle_v32i16_32_zz_33_zz_34_zz_35_zz_36_zz_37_zz_38_zz_39_z %shuffle = shufflevector <32 x i16> zeroinitializer, <32 x i16> %a, <32 x i32> ret <32 x i16> %shuffle } + +define <8 x i16> @pr32967(<32 x i16> %v) { +; ALL-LABEL: pr32967: +; ALL: # BB#0: +; ALL-NEXT: vpextrw $5, %xmm0, %eax +; ALL-NEXT: vpextrw $1, %xmm0, %ecx +; ALL-NEXT: vmovd %ecx, %xmm1 +; ALL-NEXT: vpinsrw $1, %eax, %xmm1, %xmm1 +; ALL-NEXT: vextracti32x4 $1, %zmm0, %xmm2 +; ALL-NEXT: vpextrw $1, %xmm2, %eax +; ALL-NEXT: vpinsrw $2, %eax, %xmm1, %xmm1 +; ALL-NEXT: vpextrw $5, %xmm2, %eax +; ALL-NEXT: vpinsrw $3, %eax, %xmm1, %xmm1 +; ALL-NEXT: vextracti32x4 $2, %zmm0, %xmm2 +; ALL-NEXT: vpextrw $1, %xmm2, %eax +; ALL-NEXT: vpinsrw $4, %eax, %xmm1, %xmm1 +; ALL-NEXT: vpblendw {{.*#+}} xmm1 = xmm1[0,1,2,3,4],xmm2[5],xmm1[6,7] +; ALL-NEXT: vextracti32x4 $3, %zmm0, %xmm0 +; ALL-NEXT: vpextrw $1, %xmm0, %eax +; ALL-NEXT: vpinsrw $6, %eax, %xmm1, %xmm1 +; ALL-NEXT: vpextrw $5, %xmm0, %eax +; ALL-NEXT: vpinsrw $7, %eax, %xmm1, %xmm0 +; ALL-NEXT: vzeroupper +; ALL-NEXT: retq + %shuffle = shufflevector <32 x i16> %v, <32 x i16> undef, <8 x i32> + ret <8 x i16> %shuffle +}