From 8e8b9bd42f81cda019817e1188e2aaf790e2ca55 Mon Sep 17 00:00:00 2001 From: Chandler Carruth Date: Sun, 15 Feb 2015 07:05:50 +0000 Subject: [PATCH] [x86] Add a test case for PR22390 which was a dup of PR22377 and fixed by r229285. This is a nice different test case though, so I'd like to have the extra testing of these kinds of patterns. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229286 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/CodeGen/X86/vector-shuffle-combining.ll | 41 +++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-) diff --git a/test/CodeGen/X86/vector-shuffle-combining.ll b/test/CodeGen/X86/vector-shuffle-combining.ll index 3b1e1892c07..67da5b84ebd 100644 --- a/test/CodeGen/X86/vector-shuffle-combining.ll +++ b/test/CodeGen/X86/vector-shuffle-combining.ll @@ -2538,7 +2538,7 @@ define <4 x float> @combine_insertps4(<4 x float> %a, <4 x float> %b) { ret <4 x float> %d } -define <4 x float> @PR22377(<4 x float> %a, <4 x float> %b) #0 { +define <4 x float> @PR22377(<4 x float> %a, <4 x float> %b) { ; SSE-LABEL: PR22377: ; SSE: # BB#0: # %entry ; SSE-NEXT: movaps %xmm0, %xmm1 @@ -2562,3 +2562,42 @@ entry: %s3 = shufflevector <4 x float> %s2, <4 x float> %r2, <4 x i32> ret <4 x float> %s3 } + +define <4 x float> @PR22390(<4 x float> %a, <4 x float> %b) { +; SSE2-LABEL: PR22390: +; SSE2: # BB#0: # %entry +; SSE2-NEXT: shufps {{.*#+}} xmm0 = xmm0[3,0,1,2] +; SSE2-NEXT: movaps %xmm0, %xmm2 +; SSE2-NEXT: movss {{.*#+}} xmm2 = xmm1[0],xmm2[1,2,3] +; SSE2-NEXT: addps %xmm0, %xmm2 +; SSE2-NEXT: movaps %xmm2, %xmm0 +; SSE2-NEXT: retq +; +; SSSE3-LABEL: PR22390: +; SSSE3: # BB#0: # %entry +; SSSE3-NEXT: shufps {{.*#+}} xmm0 = xmm0[3,0,1,2] +; SSSE3-NEXT: movaps %xmm0, %xmm2 +; SSSE3-NEXT: movss {{.*#+}} xmm2 = xmm1[0],xmm2[1,2,3] +; SSSE3-NEXT: addps %xmm0, %xmm2 +; SSSE3-NEXT: movaps %xmm2, %xmm0 +; SSSE3-NEXT: retq +; +; SSE41-LABEL: PR22390: +; SSE41: # BB#0: # %entry +; SSE41-NEXT: shufps {{.*#+}} xmm0 = xmm0[3,0,1,2] +; SSE41-NEXT: blendps {{.*#+}} xmm1 = xmm1[0],xmm0[1,2,3] +; SSE41-NEXT: addps %xmm1, %xmm0 +; SSE41-NEXT: retq +; +; AVX-LABEL: PR22390: +; AVX: # BB#0: # %entry +; AVX-NEXT: vpermilps {{.*#+}} xmm0 = xmm0[3,0,1,2] +; AVX-NEXT: vblendps {{.*#+}} xmm1 = xmm1[0],xmm0[1,2,3] +; AVX-NEXT: vaddps %xmm1, %xmm0, %xmm0 +; AVX-NEXT: retq +entry: + %s1 = shufflevector <4 x float> %a, <4 x float> undef, <4 x i32> + %s2 = shufflevector <4 x float> %s1, <4 x float> %b, <4 x i32> + %r2 = fadd <4 x float> %s1, %s2 + ret <4 x float> %r2 +} -- 2.34.1