@@ -773,3 +773,29 @@ define <8 x float> @splat0_fdiv_const_op0_v8f32(<8 x float> %vx) {
773
773
%r = shufflevector <8 x float > %b , <8 x float > undef , <8 x i32 > zeroinitializer
774
774
ret <8 x float > %r
775
775
}
776
+
777
+ define <4 x float > @multi_use_binop (<4 x float > %x , <4 x float > %y ) {
778
+ ; SSE-LABEL: multi_use_binop:
779
+ ; SSE: # %bb.0:
780
+ ; SSE-NEXT: movaps %xmm0, %xmm2
781
+ ; SSE-NEXT: mulps %xmm1, %xmm2
782
+ ; SSE-NEXT: mulss %xmm1, %xmm0
783
+ ; SSE-NEXT: shufps {{.*#+}} xmm0 = xmm0[0,0,0,0]
784
+ ; SSE-NEXT: movlhps {{.*#+}} xmm1 = xmm1[0],xmm2[0]
785
+ ; SSE-NEXT: addps %xmm1, %xmm0
786
+ ; SSE-NEXT: retq
787
+ ;
788
+ ; AVX-LABEL: multi_use_binop:
789
+ ; AVX: # %bb.0:
790
+ ; AVX-NEXT: vmulps %xmm1, %xmm0, %xmm2
791
+ ; AVX-NEXT: vmulss %xmm1, %xmm0, %xmm0
792
+ ; AVX-NEXT: vpermilps {{.*#+}} xmm0 = xmm0[0,0,0,0]
793
+ ; AVX-NEXT: vmovddup {{.*#+}} xmm1 = xmm2[0,0]
794
+ ; AVX-NEXT: vaddps %xmm1, %xmm0, %xmm0
795
+ ; AVX-NEXT: retq
796
+ %mul = fmul <4 x float > %x , %y
797
+ %mul0 = shufflevector <4 x float > %mul , <4 x float > undef , <4 x i32 > <i32 undef , i32 undef , i32 undef , i32 0 >
798
+ %mul1 = shufflevector <4 x float > %mul , <4 x float > undef , <4 x i32 > <i32 undef , i32 undef , i32 undef , i32 1 >
799
+ %r = fadd <4 x float > %mul0 , %mul1
800
+ ret <4 x float > %r
801
+ }
0 commit comments