[X86] Add test case to show failure to handle splat vectors in the constant check...
authorCraig Topper <craig.topper@intel.com>
Sun, 28 Oct 2018 23:51:33 +0000 (23:51 +0000)
committerCraig Topper <craig.topper@intel.com>
Sun, 28 Oct 2018 23:51:33 +0000 (23:51 +0000)
llvm-svn: 345483

llvm/test/CodeGen/X86/sse1-fcopysign.ll

index 5132573..59598ec 100644 (file)
@@ -68,5 +68,25 @@ define <4 x float> @v4f32_neg(<4 x float> %a, <4 x float> %b) nounwind {
   ret <4 x float> %tmp
 }
 
+define <4 x float> @v4f32_const_mag(<4 x float> %a, <4 x float> %b) nounwind {
+; X86-LABEL: v4f32_const_mag:
+; X86:       # %bb.0:
+; X86-NEXT:    andps {{\.LCPI.*}}, %xmm1
+; X86-NEXT:    movaps {{.*#+}} xmm0 = [1,1,1,1]
+; X86-NEXT:    andps {{\.LCPI.*}}, %xmm0
+; X86-NEXT:    orps %xmm1, %xmm0
+; X86-NEXT:    retl
+;
+; X64-LABEL: v4f32_const_mag:
+; X64:       # %bb.0:
+; X64-NEXT:    andps {{.*}}(%rip), %xmm1
+; X64-NEXT:    movaps {{.*#+}} xmm0 = [1,1,1,1]
+; X64-NEXT:    andps {{.*}}(%rip), %xmm0
+; X64-NEXT:    orps %xmm1, %xmm0
+; X64-NEXT:    retq
+  %tmp = tail call <4 x float> @llvm.copysign.v4f32(<4 x float> <float 1.0, float 1.0, float 1.0, float 1.0>, <4 x float> %b )
+  ret <4 x float> %tmp
+}
+
 declare float @llvm.copysign.f32(float, float)
 declare <4 x float> @llvm.copysign.v4f32(<4 x float>, <4 x float>)