[llvm] r344523 - [x86] add tests for fma with undef elts; NFC

Sanjay Patel via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 15 08:28:45 PDT 2018


Author: spatel
Date: Mon Oct 15 08:28:44 2018
New Revision: 344523

URL: http://llvm.org/viewvc/llvm-project?rev=344523&view=rev
Log:
[x86] add tests for fma with undef elts; NFC

Modified:
    llvm/trunk/test/CodeGen/X86/fma_patterns.ll

Modified: llvm/trunk/test/CodeGen/X86/fma_patterns.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/fma_patterns.ll?rev=344523&r1=344522&r2=344523&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/X86/fma_patterns.ll (original)
+++ llvm/trunk/test/CodeGen/X86/fma_patterns.ll Mon Oct 15 08:28:44 2018
@@ -636,6 +636,29 @@ define <4 x float> @test_v4f32_mul_y_add
   ret <4 x float> %m
 }
 
+define <4 x float> @test_v4f32_mul_y_add_x_one_undefs(<4 x float> %x, <4 x float> %y) {
+; FMA-LABEL: test_v4f32_mul_y_add_x_one_undefs:
+; FMA:       # %bb.0:
+; FMA-NEXT:    vaddps {{.*}}(%rip), %xmm0, %xmm0
+; FMA-NEXT:    vmulps %xmm0, %xmm1, %xmm0
+; FMA-NEXT:    retq
+;
+; FMA4-LABEL: test_v4f32_mul_y_add_x_one_undefs:
+; FMA4:       # %bb.0:
+; FMA4-NEXT:    vaddps {{.*}}(%rip), %xmm0, %xmm0
+; FMA4-NEXT:    vmulps %xmm0, %xmm1, %xmm0
+; FMA4-NEXT:    retq
+;
+; AVX512-LABEL: test_v4f32_mul_y_add_x_one_undefs:
+; AVX512:       # %bb.0:
+; AVX512-NEXT:    vaddps {{.*}}(%rip){1to4}, %xmm0, %xmm0
+; AVX512-NEXT:    vmulps %xmm0, %xmm1, %xmm0
+; AVX512-NEXT:    retq
+  %a = fadd <4 x float> %x, <float 1.0, float undef, float 1.0, float undef>
+  %m = fmul <4 x float> %y, %a
+  ret <4 x float> %m
+}
+
 define <4 x float> @test_v4f32_mul_add_x_negone_y(<4 x float> %x, <4 x float> %y) {
 ; FMA-INFS-LABEL: test_v4f32_mul_add_x_negone_y:
 ; FMA-INFS:       # %bb.0:
@@ -711,6 +734,29 @@ define <4 x float> @test_v4f32_mul_y_add
   %m = fmul <4 x float> %y, %a
   ret <4 x float> %m
 }
+
+define <4 x float> @test_v4f32_mul_y_add_x_negone_undefs(<4 x float> %x, <4 x float> %y) {
+; FMA-LABEL: test_v4f32_mul_y_add_x_negone_undefs:
+; FMA:       # %bb.0:
+; FMA-NEXT:    vaddps {{.*}}(%rip), %xmm0, %xmm0
+; FMA-NEXT:    vmulps %xmm0, %xmm1, %xmm0
+; FMA-NEXT:    retq
+;
+; FMA4-LABEL: test_v4f32_mul_y_add_x_negone_undefs:
+; FMA4:       # %bb.0:
+; FMA4-NEXT:    vaddps {{.*}}(%rip), %xmm0, %xmm0
+; FMA4-NEXT:    vmulps %xmm0, %xmm1, %xmm0
+; FMA4-NEXT:    retq
+;
+; AVX512-LABEL: test_v4f32_mul_y_add_x_negone_undefs:
+; AVX512:       # %bb.0:
+; AVX512-NEXT:    vaddps {{.*}}(%rip){1to4}, %xmm0, %xmm0
+; AVX512-NEXT:    vmulps %xmm0, %xmm1, %xmm0
+; AVX512-NEXT:    retq
+  %a = fadd <4 x float> %x, <float undef, float -1.0, float undef, float -1.0>
+  %m = fmul <4 x float> %y, %a
+  ret <4 x float> %m
+}
 
 define <4 x float> @test_v4f32_mul_sub_one_x_y(<4 x float> %x, <4 x float> %y) {
 ; FMA-INFS-LABEL: test_v4f32_mul_sub_one_x_y:




More information about the llvm-commits mailing list