llvm/llvm/test/Transforms/SLPVectorizer/AArch64/slp-frem.ll

; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 4
; RUN: opt < %s -S -mtriple=aarch64 -vector-library=ArmPL -passes=slp-vectorizer | FileCheck %s

@a = common global ptr null, align 8

define void @frem_v2double() {
; CHECK-LABEL: define void @frem_v2double() {
; CHECK-NEXT:  entry:
; CHECK-NEXT:    [[TMP0:%.*]] = load <2 x double>, ptr @a, align 8
; CHECK-NEXT:    [[TMP1:%.*]] = load <2 x double>, ptr @a, align 8
; CHECK-NEXT:    [[TMP2:%.*]] = frem <2 x double> [[TMP0]], [[TMP1]]
; CHECK-NEXT:    store <2 x double> [[TMP2]], ptr @a, align 8
; CHECK-NEXT:    ret void
;
entry:
  %a0 = load double, ptr getelementptr inbounds (double, ptr @a, i64 0), align 8
  %a1 = load double, ptr getelementptr inbounds (double, ptr @a, i64 1), align 8
  %b0 = load double, ptr getelementptr inbounds (double, ptr @a, i64 0), align 8
  %b1 = load double, ptr getelementptr inbounds (double, ptr @a, i64 1), align 8
  %r0 = frem double %a0, %b0
  %r1 = frem double %a1, %b1
  store double %r0, ptr getelementptr inbounds (double, ptr @a, i64 0), align 8
  store double %r1, ptr getelementptr inbounds (double, ptr @a, i64 1), align 8
  ret void
}

define void @frem_v4float() {
; CHECK-LABEL: define void @frem_v4float() {
; CHECK-NEXT:  entry:
; CHECK-NEXT:    [[TMP0:%.*]] = load <4 x float>, ptr @a, align 8
; CHECK-NEXT:    [[TMP1:%.*]] = load <4 x float>, ptr @a, align 8
; CHECK-NEXT:    [[TMP2:%.*]] = frem <4 x float> [[TMP0]], [[TMP1]]
; CHECK-NEXT:    store <4 x float> [[TMP2]], ptr @a, align 8
; CHECK-NEXT:    ret void
;
entry:
  %a0 = load float, ptr getelementptr inbounds (float, ptr @a, i64 0), align 8
  %a1 = load float, ptr getelementptr inbounds (float, ptr @a, i64 1), align 8
  %a2 = load float, ptr getelementptr inbounds (float, ptr @a, i64 2), align 8
  %a3 = load float, ptr getelementptr inbounds (float, ptr @a, i64 3), align 8
  %b0 = load float, ptr getelementptr inbounds (float, ptr @a, i64 0), align 8
  %b1 = load float, ptr getelementptr inbounds (float, ptr @a, i64 1), align 8
  %b2 = load float, ptr getelementptr inbounds (float, ptr @a, i64 2), align 8
  %b3 = load float, ptr getelementptr inbounds (float, ptr @a, i64 3), align 8
  %r0 = frem float %a0, %b0
  %r1 = frem float %a1, %b1
  %r2 = frem float %a2, %b2
  %r3 = frem float %a3, %b3
  store float %r0, ptr getelementptr inbounds (float, ptr @a, i64 0), align 8
  store float %r1, ptr getelementptr inbounds (float, ptr @a, i64 1), align 8
  store float %r2, ptr getelementptr inbounds (float, ptr @a, i64 2), align 8
  store float %r3, ptr getelementptr inbounds (float, ptr @a, i64 3), align 8
  ret void
}