[llvm] r372883 - [x86] add test for multi-use scalarization of vector binop; NFC
Sanjay Patel via llvm-commits
llvm-commits at lists.llvm.org
Wed Sep 25 07:57:46 PDT 2019
Author: spatel
Date: Wed Sep 25 07:57:45 2019
New Revision: 372883
URL: http://llvm.org/viewvc/llvm-project?rev=372883&view=rev
Log:
[x86] add test for multi-use scalarization of vector binop; NFC
Modified:
llvm/trunk/test/CodeGen/X86/scalarize-fp.ll
Modified: llvm/trunk/test/CodeGen/X86/scalarize-fp.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/scalarize-fp.ll?rev=372883&r1=372882&r2=372883&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/X86/scalarize-fp.ll (original)
+++ llvm/trunk/test/CodeGen/X86/scalarize-fp.ll Wed Sep 25 07:57:45 2019
@@ -773,3 +773,29 @@ define <8 x float> @splat0_fdiv_const_op
%r = shufflevector <8 x float> %b, <8 x float> undef, <8 x i32> zeroinitializer
ret <8 x float> %r
}
+
+define <4 x float> @multi_use_binop(<4 x float> %x, <4 x float> %y) {
+; SSE-LABEL: multi_use_binop:
+; SSE: # %bb.0:
+; SSE-NEXT: movaps %xmm0, %xmm2
+; SSE-NEXT: mulps %xmm1, %xmm2
+; SSE-NEXT: mulss %xmm1, %xmm0
+; SSE-NEXT: shufps {{.*#+}} xmm0 = xmm0[0,0,0,0]
+; SSE-NEXT: movlhps {{.*#+}} xmm1 = xmm1[0],xmm2[0]
+; SSE-NEXT: addps %xmm1, %xmm0
+; SSE-NEXT: retq
+;
+; AVX-LABEL: multi_use_binop:
+; AVX: # %bb.0:
+; AVX-NEXT: vmulps %xmm1, %xmm0, %xmm2
+; AVX-NEXT: vmulss %xmm1, %xmm0, %xmm0
+; AVX-NEXT: vpermilps {{.*#+}} xmm0 = xmm0[0,0,0,0]
+; AVX-NEXT: vmovddup {{.*#+}} xmm1 = xmm2[0,0]
+; AVX-NEXT: vaddps %xmm1, %xmm0, %xmm0
+; AVX-NEXT: retq
+ %mul = fmul <4 x float> %x, %y
+ %mul0 = shufflevector <4 x float> %mul, <4 x float> undef, <4 x i32> <i32 undef, i32 undef, i32 undef, i32 0>
+ %mul1 = shufflevector <4 x float> %mul, <4 x float> undef, <4 x i32> <i32 undef, i32 undef, i32 undef, i32 1>
+ %r = fadd <4 x float> %mul0, %mul1
+ ret <4 x float> %r
+}
More information about the llvm-commits
mailing list