[llvm] r343941 - [x86] add vector fmul with undef elts tests; NFC

Sanjay Patel via llvm-commits llvm-commits at lists.llvm.org
Sun Oct 7 09:00:55 PDT 2018


Author: spatel
Date: Sun Oct  7 09:00:55 2018
New Revision: 343941

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

Modified:
    llvm/trunk/test/CodeGen/X86/fmul-combines.ll

Modified: llvm/trunk/test/CodeGen/X86/fmul-combines.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/fmul-combines.ll?rev=343941&r1=343940&r2=343941&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/X86/fmul-combines.ll (original)
+++ llvm/trunk/test/CodeGen/X86/fmul-combines.ll Sun Oct  7 09:00:55 2018
@@ -1,6 +1,35 @@
 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
 ; RUN: llc -mtriple=x86_64-unknown-unknown < %s | FileCheck %s
 
+define <4 x float> @fmul_zero_not_fast(<4 x float> %x) nounwind {
+; CHECK-LABEL: fmul_zero_not_fast:
+; CHECK:       # %bb.0:
+; CHECK-NEXT:    xorps %xmm1, %xmm1
+; CHECK-NEXT:    mulps %xmm1, %xmm0
+; CHECK-NEXT:    retq
+  %r = fmul <4 x float> %x, zeroinitializer
+  ret <4 x float> %r
+}
+
+define <4 x float> @fmul_zero_nsz_nnan(<4 x float> %x) nounwind {
+; CHECK-LABEL: fmul_zero_nsz_nnan:
+; CHECK:       # %bb.0:
+; CHECK-NEXT:    xorps %xmm0, %xmm0
+; CHECK-NEXT:    retq
+  %r = fmul nsz nnan <4 x float> %x, zeroinitializer
+  ret <4 x float> %r
+}
+
+define <4 x float> @fmul_zero_nsz_nnan_undef(<4 x float> %x) nounwind {
+; CHECK-LABEL: fmul_zero_nsz_nnan_undef:
+; CHECK:       # %bb.0:
+; CHECK-NEXT:    xorps %xmm1, %xmm1
+; CHECK-NEXT:    mulps %xmm1, %xmm0
+; CHECK-NEXT:    retq
+  %r = fmul nsz nnan <4 x float> %x, <float 0.0, float 0.0, float 0.0, float undef>
+  ret <4 x float> %r
+}
+
 define float @fmul2_f32(float %x) {
 ; CHECK-LABEL: fmul2_f32:
 ; CHECK:       # %bb.0:
@@ -21,6 +50,15 @@ define <4 x float> @fmul2_v4f32(<4 x flo
   ret <4 x float> %y
 }
 
+define <4 x float> @fmul2_v4f32_undef(<4 x float> %x) {
+; CHECK-LABEL: fmul2_v4f32_undef:
+; CHECK:       # %bb.0:
+; CHECK-NEXT:    mulps {{.*}}(%rip), %xmm0
+; CHECK-NEXT:    retq
+  %y = fmul <4 x float> %x, <float undef, float 2.0, float 2.0, float 2.0>
+  ret <4 x float> %y
+}
+
 define <4 x float> @constant_fold_fmul_v4f32(<4 x float> %x) {
 ; CHECK-LABEL: constant_fold_fmul_v4f32:
 ; CHECK:       # %bb.0:
@@ -30,6 +68,15 @@ define <4 x float> @constant_fold_fmul_v
   ret <4 x float> %y
 }
 
+define <4 x float> @constant_fold_fmul_v4f32_undef(<4 x float> %x) {
+; CHECK-LABEL: constant_fold_fmul_v4f32_undef:
+; CHECK:       # %bb.0:
+; CHECK-NEXT:    movaps {{.*#+}} xmm0 = [8,NaN,8,NaN]
+; CHECK-NEXT:    retq
+  %y = fmul <4 x float> <float 4.0, float undef, float 4.0, float 4.0>, <float 2.0, float 2.0, float 2.0, float undef>
+  ret <4 x float> %y
+}
+
 define <4 x float> @fmul0_v4f32(<4 x float> %x) #0 {
 ; CHECK-LABEL: fmul0_v4f32:
 ; CHECK:       # %bb.0:
@@ -39,6 +86,16 @@ define <4 x float> @fmul0_v4f32(<4 x flo
   ret <4 x float> %y
 }
 
+define <4 x float> @fmul0_v4f32_undef(<4 x float> %x) #0 {
+; CHECK-LABEL: fmul0_v4f32_undef:
+; CHECK:       # %bb.0:
+; CHECK-NEXT:    xorps %xmm1, %xmm1
+; CHECK-NEXT:    mulps %xmm1, %xmm0
+; CHECK-NEXT:    retq
+  %y = fmul <4 x float> %x, <float undef, float 0.0, float undef, float 0.0>
+  ret <4 x float> %y
+}
+
 define <4 x float> @fmul_c2_c4_v4f32(<4 x float> %x) #0 {
 ; CHECK-LABEL: fmul_c2_c4_v4f32:
 ; CHECK:       # %bb.0:




More information about the llvm-commits mailing list