<commit_before>; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
; RUN: llc -mtriple=x86_64-unknown-unknown < %s | FileCheck %s

define float @fmul2_f32(float %x) {
; CHECK-LABEL: fmul2_f32:
; CHECK:       # %bb.0:
; CHECK-NEXT:    addss %xmm0, %xmm0
; CHECK-NEXT:    retq
  %y = fmul float %x, 2.0
  ret float %y
}

; fmul 2.0, x -> fadd x, x for vectors.

define <4 x float> @fmul2_v4f32(<4 x float> %x) {
; CHECK-LABEL: fmul2_v4f32:
; CHECK:       # %bb.0:
; CHECK-NEXT:    addps %xmm0, %xmm0
; CHECK-NEXT:    retq
  %y = fmul <4 x float> %x, <float 2.0, 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:
; CHECK-NEXT:    movaps {{.*#+}} xmm0 = [8,8,8,8]
; CHECK-NEXT:    retq
  %y = fmul <4 x float> <float 4.0, float 4.0, float 4.0, float 4.0>, <float 2.0, float 2.0, float 2.0, float 2.0>
  ret <4 x float> %y
}

define <4 x float> @fmul0_v4f32(<4 x float> %x) #0 {
; CHECK-LABEL: fmul0_v4f32:
; CHECK:       # %bb.0:
; CHECK-NEXT:    xorps %xmm0, %xmm0
; CHECK-NEXT:    retq
  %y = fmul <4 x float> %x, <float 0.0, float 0.0, float 0.0, float 0.0>
  ret <4 x float> %y
}
<commit_msg>[x86] add vector fmul with undef elts tests; NFC <commit_after>; 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:
; CHECK-NEXT:    addss %xmm0, %xmm0
; CHECK-NEXT:    retq
  %y = fmul float %x, 2.0
  ret float %y
}

; fmul 2.0, x -> fadd x, x for vectors.

define <4 x float> @fmul2_v4f32(<4 x float> %x) {
; CHECK-LABEL: fmul2_v4f32:
; CHECK:       # %bb.0:
; CHECK-NEXT:    addps %xmm0, %xmm0
; CHECK-NEXT:    retq
  %y = fmul <4 x float> %x, <float 2.0, float 2.0, float 2.0, float 2.0>
  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:
; CHECK-NEXT:    movaps {{.*#+}} xmm0 = [8,8,8,8]
; CHECK-NEXT:    retq
  %y = fmul <4 x float> <float 4.0, float 4.0, float 4.0, float 4.0>, <float 2.0, float 2.0, float 2.0, float 2.0>
  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:
; CHECK-NEXT:    xorps %xmm0, %xmm0
; CHECK-NEXT:    retq
  %y = fmul <4 x float> %x, <float 0.0, float 0.0, float 0.0, float 0.0>
  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
}

{'fraction_non_alphanumeric': 0.1688371030386109, 'fraction_numerical': 0.0669408270504912, 'mean_word_length': 3.061224489795918, 'pattern_counts': {'":': 0, '<': 66, '<?xml version=': 0, '>': 66, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3083877', 'n_tokens_mistral': 2135, 'n_tokens_neox': 2010, 'n_words': 570}