blob: 301e5da28f0d83afc5bd578b44a33c4487747fc4 [file] [log] [blame]
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt -S -passes=slp-vectorizer -mtriple=aarch64 < %s | FileCheck %s
target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128"
define void @ldexp_f32i32(ptr %x, ptr %y, i32 %exp) {
; CHECK-LABEL: @ldexp_f32i32(
; CHECK-NEXT: entry:
; CHECK-NEXT: [[L0:%.*]] = load float, ptr [[X:%.*]], align 4
; CHECK-NEXT: [[ARRAYIDX_1:%.*]] = getelementptr inbounds float, ptr [[X]], i64 1
; CHECK-NEXT: [[L2:%.*]] = load float, ptr [[ARRAYIDX_1]], align 4
; CHECK-NEXT: [[ARRAYIDX_2:%.*]] = getelementptr inbounds float, ptr [[X]], i64 2
; CHECK-NEXT: [[L4:%.*]] = load float, ptr [[ARRAYIDX_2]], align 4
; CHECK-NEXT: [[ARRAYIDX_3:%.*]] = getelementptr inbounds float, ptr [[X]], i64 3
; CHECK-NEXT: [[L6:%.*]] = load float, ptr [[ARRAYIDX_3]], align 4
; CHECK-NEXT: [[L1:%.*]] = tail call float @llvm.ldexp.f32.i32(float [[L0]], i32 [[EXP:%.*]])
; CHECK-NEXT: [[L3:%.*]] = tail call float @llvm.ldexp.f32.i32(float [[L2]], i32 [[EXP]])
; CHECK-NEXT: [[L5:%.*]] = tail call float @llvm.ldexp.f32.i32(float [[L4]], i32 [[EXP]])
; CHECK-NEXT: [[L7:%.*]] = tail call float @llvm.ldexp.f32.i32(float [[L6]], i32 [[EXP]])
; CHECK-NEXT: store float [[L1]], ptr [[Y:%.*]], align 4
; CHECK-NEXT: [[ARRAYIDX2_1:%.*]] = getelementptr inbounds float, ptr [[Y]], i64 1
; CHECK-NEXT: store float [[L3]], ptr [[ARRAYIDX2_1]], align 4
; CHECK-NEXT: [[ARRAYIDX2_2:%.*]] = getelementptr inbounds float, ptr [[Y]], i64 2
; CHECK-NEXT: store float [[L5]], ptr [[ARRAYIDX2_2]], align 4
; CHECK-NEXT: [[ARRAYIDX2_3:%.*]] = getelementptr inbounds float, ptr [[Y]], i64 3
; CHECK-NEXT: store float [[L7]], ptr [[ARRAYIDX2_3]], align 4
; CHECK-NEXT: ret void
;
entry:
%l0 = load float, ptr %x, align 4
%arrayidx.1 = getelementptr inbounds float, ptr %x, i64 1
%l2 = load float, ptr %arrayidx.1, align 4
%arrayidx.2 = getelementptr inbounds float, ptr %x, i64 2
%l4 = load float, ptr %arrayidx.2, align 4
%arrayidx.3 = getelementptr inbounds float, ptr %x, i64 3
%l6 = load float, ptr %arrayidx.3, align 4
%l1 = tail call float @llvm.ldexp.f32.i32(float %l0, i32 %exp)
%l3 = tail call float @llvm.ldexp.f32.i32(float %l2, i32 %exp)
%l5 = tail call float @llvm.ldexp.f32.i32(float %l4, i32 %exp)
%l7 = tail call float @llvm.ldexp.f32.i32(float %l6, i32 %exp)
store float %l1, ptr %y, align 4
%arrayidx2.1 = getelementptr inbounds float, ptr %y, i64 1
store float %l3, ptr %arrayidx2.1, align 4
%arrayidx2.2 = getelementptr inbounds float, ptr %y, i64 2
store float %l5, ptr %arrayidx2.2, align 4
%arrayidx2.3 = getelementptr inbounds float, ptr %y, i64 3
store float %l7, ptr %arrayidx2.3, align 4
ret void
}
define void @ldexp_f64i32(ptr %x, ptr %y, i32 %exp) {
; CHECK-LABEL: @ldexp_f64i32(
; CHECK-NEXT: entry:
; CHECK-NEXT: [[L0:%.*]] = load double, ptr [[X:%.*]], align 4
; CHECK-NEXT: [[ARRAYIDX_1:%.*]] = getelementptr inbounds double, ptr [[X]], i64 1
; CHECK-NEXT: [[L2:%.*]] = load double, ptr [[ARRAYIDX_1]], align 4
; CHECK-NEXT: [[ARRAYIDX_2:%.*]] = getelementptr inbounds double, ptr [[X]], i64 2
; CHECK-NEXT: [[L4:%.*]] = load double, ptr [[ARRAYIDX_2]], align 4
; CHECK-NEXT: [[ARRAYIDX_3:%.*]] = getelementptr inbounds double, ptr [[X]], i64 3
; CHECK-NEXT: [[L6:%.*]] = load double, ptr [[ARRAYIDX_3]], align 4
; CHECK-NEXT: [[L1:%.*]] = tail call double @llvm.ldexp.f64.i32(double [[L0]], i32 [[EXP:%.*]])
; CHECK-NEXT: [[L3:%.*]] = tail call double @llvm.ldexp.f64.i32(double [[L2]], i32 [[EXP]])
; CHECK-NEXT: [[L5:%.*]] = tail call double @llvm.ldexp.f64.i32(double [[L4]], i32 [[EXP]])
; CHECK-NEXT: [[L7:%.*]] = tail call double @llvm.ldexp.f64.i32(double [[L6]], i32 [[EXP]])
; CHECK-NEXT: store double [[L1]], ptr [[Y:%.*]], align 4
; CHECK-NEXT: [[ARRAYIDX2_1:%.*]] = getelementptr inbounds double, ptr [[Y]], i64 1
; CHECK-NEXT: store double [[L3]], ptr [[ARRAYIDX2_1]], align 4
; CHECK-NEXT: [[ARRAYIDX2_2:%.*]] = getelementptr inbounds double, ptr [[Y]], i64 2
; CHECK-NEXT: store double [[L5]], ptr [[ARRAYIDX2_2]], align 4
; CHECK-NEXT: [[ARRAYIDX2_3:%.*]] = getelementptr inbounds double, ptr [[Y]], i64 3
; CHECK-NEXT: store double [[L7]], ptr [[ARRAYIDX2_3]], align 4
; CHECK-NEXT: ret void
;
entry:
%l0 = load double, ptr %x, align 4
%arrayidx.1 = getelementptr inbounds double, ptr %x, i64 1
%l2 = load double, ptr %arrayidx.1, align 4
%arrayidx.2 = getelementptr inbounds double, ptr %x, i64 2
%l4 = load double, ptr %arrayidx.2, align 4
%arrayidx.3 = getelementptr inbounds double, ptr %x, i64 3
%l6 = load double, ptr %arrayidx.3, align 4
%l1 = tail call double @llvm.ldexp.f64.i32(double %l0, i32 %exp)
%l3 = tail call double @llvm.ldexp.f64.i32(double %l2, i32 %exp)
%l5 = tail call double @llvm.ldexp.f64.i32(double %l4, i32 %exp)
%l7 = tail call double @llvm.ldexp.f64.i32(double %l6, i32 %exp)
store double %l1, ptr %y, align 4
%arrayidx2.1 = getelementptr inbounds double, ptr %y, i64 1
store double %l3, ptr %arrayidx2.1, align 4
%arrayidx2.2 = getelementptr inbounds double, ptr %y, i64 2
store double %l5, ptr %arrayidx2.2, align 4
%arrayidx2.3 = getelementptr inbounds double, ptr %y, i64 3
store double %l7, ptr %arrayidx2.3, align 4
ret void
}
define void @ldexp_f32i64(ptr %x, ptr %y, i64 %exp) {
; CHECK-LABEL: @ldexp_f32i64(
; CHECK-NEXT: entry:
; CHECK-NEXT: [[L0:%.*]] = load float, ptr [[X:%.*]], align 4
; CHECK-NEXT: [[ARRAYIDX_1:%.*]] = getelementptr inbounds float, ptr [[X]], i64 1
; CHECK-NEXT: [[L2:%.*]] = load float, ptr [[ARRAYIDX_1]], align 4
; CHECK-NEXT: [[ARRAYIDX_2:%.*]] = getelementptr inbounds float, ptr [[X]], i64 2
; CHECK-NEXT: [[L4:%.*]] = load float, ptr [[ARRAYIDX_2]], align 4
; CHECK-NEXT: [[ARRAYIDX_3:%.*]] = getelementptr inbounds float, ptr [[X]], i64 3
; CHECK-NEXT: [[L6:%.*]] = load float, ptr [[ARRAYIDX_3]], align 4
; CHECK-NEXT: [[L1:%.*]] = tail call float @llvm.ldexp.f32.i64(float [[L0]], i64 [[EXP:%.*]])
; CHECK-NEXT: [[L3:%.*]] = tail call float @llvm.ldexp.f32.i64(float [[L2]], i64 [[EXP]])
; CHECK-NEXT: [[L5:%.*]] = tail call float @llvm.ldexp.f32.i64(float [[L4]], i64 [[EXP]])
; CHECK-NEXT: [[L7:%.*]] = tail call float @llvm.ldexp.f32.i64(float [[L6]], i64 [[EXP]])
; CHECK-NEXT: store float [[L1]], ptr [[Y:%.*]], align 4
; CHECK-NEXT: [[ARRAYIDX2_1:%.*]] = getelementptr inbounds float, ptr [[Y]], i64 1
; CHECK-NEXT: store float [[L3]], ptr [[ARRAYIDX2_1]], align 4
; CHECK-NEXT: [[ARRAYIDX2_2:%.*]] = getelementptr inbounds float, ptr [[Y]], i64 2
; CHECK-NEXT: store float [[L5]], ptr [[ARRAYIDX2_2]], align 4
; CHECK-NEXT: [[ARRAYIDX2_3:%.*]] = getelementptr inbounds float, ptr [[Y]], i64 3
; CHECK-NEXT: store float [[L7]], ptr [[ARRAYIDX2_3]], align 4
; CHECK-NEXT: ret void
;
entry:
%l0 = load float, ptr %x, align 4
%arrayidx.1 = getelementptr inbounds float, ptr %x, i64 1
%l2 = load float, ptr %arrayidx.1, align 4
%arrayidx.2 = getelementptr inbounds float, ptr %x, i64 2
%l4 = load float, ptr %arrayidx.2, align 4
%arrayidx.3 = getelementptr inbounds float, ptr %x, i64 3
%l6 = load float, ptr %arrayidx.3, align 4
%l1 = tail call float @llvm.ldexp.f32.i64(float %l0, i64 %exp)
%l3 = tail call float @llvm.ldexp.f32.i64(float %l2, i64 %exp)
%l5 = tail call float @llvm.ldexp.f32.i64(float %l4, i64 %exp)
%l7 = tail call float @llvm.ldexp.f32.i64(float %l6, i64 %exp)
store float %l1, ptr %y, align 4
%arrayidx2.1 = getelementptr inbounds float, ptr %y, i64 1
store float %l3, ptr %arrayidx2.1, align 4
%arrayidx2.2 = getelementptr inbounds float, ptr %y, i64 2
store float %l5, ptr %arrayidx2.2, align 4
%arrayidx2.3 = getelementptr inbounds float, ptr %y, i64 3
store float %l7, ptr %arrayidx2.3, align 4
ret void
}
define void @ldexp_f64i64(ptr %x, ptr %y, i64 %exp) {
; CHECK-LABEL: @ldexp_f64i64(
; CHECK-NEXT: entry:
; CHECK-NEXT: [[L0:%.*]] = load double, ptr [[X:%.*]], align 4
; CHECK-NEXT: [[ARRAYIDX_1:%.*]] = getelementptr inbounds double, ptr [[X]], i64 1
; CHECK-NEXT: [[L2:%.*]] = load double, ptr [[ARRAYIDX_1]], align 4
; CHECK-NEXT: [[ARRAYIDX_2:%.*]] = getelementptr inbounds double, ptr [[X]], i64 2
; CHECK-NEXT: [[L4:%.*]] = load double, ptr [[ARRAYIDX_2]], align 4
; CHECK-NEXT: [[ARRAYIDX_3:%.*]] = getelementptr inbounds double, ptr [[X]], i64 3
; CHECK-NEXT: [[L6:%.*]] = load double, ptr [[ARRAYIDX_3]], align 4
; CHECK-NEXT: [[L1:%.*]] = tail call double @llvm.ldexp.f64.i64(double [[L0]], i64 [[EXP:%.*]])
; CHECK-NEXT: [[L3:%.*]] = tail call double @llvm.ldexp.f64.i64(double [[L2]], i64 [[EXP]])
; CHECK-NEXT: [[L5:%.*]] = tail call double @llvm.ldexp.f64.i64(double [[L4]], i64 [[EXP]])
; CHECK-NEXT: [[L7:%.*]] = tail call double @llvm.ldexp.f64.i64(double [[L6]], i64 [[EXP]])
; CHECK-NEXT: store double [[L1]], ptr [[Y:%.*]], align 4
; CHECK-NEXT: [[ARRAYIDX2_1:%.*]] = getelementptr inbounds double, ptr [[Y]], i64 1
; CHECK-NEXT: store double [[L3]], ptr [[ARRAYIDX2_1]], align 4
; CHECK-NEXT: [[ARRAYIDX2_2:%.*]] = getelementptr inbounds double, ptr [[Y]], i64 2
; CHECK-NEXT: store double [[L5]], ptr [[ARRAYIDX2_2]], align 4
; CHECK-NEXT: [[ARRAYIDX2_3:%.*]] = getelementptr inbounds double, ptr [[Y]], i64 3
; CHECK-NEXT: store double [[L7]], ptr [[ARRAYIDX2_3]], align 4
; CHECK-NEXT: ret void
;
entry:
%l0 = load double, ptr %x, align 4
%arrayidx.1 = getelementptr inbounds double, ptr %x, i64 1
%l2 = load double, ptr %arrayidx.1, align 4
%arrayidx.2 = getelementptr inbounds double, ptr %x, i64 2
%l4 = load double, ptr %arrayidx.2, align 4
%arrayidx.3 = getelementptr inbounds double, ptr %x, i64 3
%l6 = load double, ptr %arrayidx.3, align 4
%l1 = tail call double @llvm.ldexp.f64.i64(double %l0, i64 %exp)
%l3 = tail call double @llvm.ldexp.f64.i64(double %l2, i64 %exp)
%l5 = tail call double @llvm.ldexp.f64.i64(double %l4, i64 %exp)
%l7 = tail call double @llvm.ldexp.f64.i64(double %l6, i64 %exp)
store double %l1, ptr %y, align 4
%arrayidx2.1 = getelementptr inbounds double, ptr %y, i64 1
store double %l3, ptr %arrayidx2.1, align 4
%arrayidx2.2 = getelementptr inbounds double, ptr %y, i64 2
store double %l5, ptr %arrayidx2.2, align 4
%arrayidx2.3 = getelementptr inbounds double, ptr %y, i64 3
store double %l7, ptr %arrayidx2.3, align 4
ret void
}
define void @ldexp_f32i32_i64(ptr %x, ptr %y, i32 %exp32, i64 %exp64) {
; CHECK-LABEL: @ldexp_f32i32_i64(
; CHECK-NEXT: entry:
; CHECK-NEXT: [[L0:%.*]] = load float, ptr [[X:%.*]], align 4
; CHECK-NEXT: [[ARRAYIDX_1:%.*]] = getelementptr inbounds float, ptr [[X]], i64 1
; CHECK-NEXT: [[L2:%.*]] = load float, ptr [[ARRAYIDX_1]], align 4
; CHECK-NEXT: [[ARRAYIDX_2:%.*]] = getelementptr inbounds float, ptr [[X]], i64 2
; CHECK-NEXT: [[L4:%.*]] = load float, ptr [[ARRAYIDX_2]], align 4
; CHECK-NEXT: [[ARRAYIDX_3:%.*]] = getelementptr inbounds float, ptr [[X]], i64 3
; CHECK-NEXT: [[L6:%.*]] = load float, ptr [[ARRAYIDX_3]], align 4
; CHECK-NEXT: [[L1:%.*]] = tail call float @llvm.ldexp.f32.i32(float [[L0]], i32 [[EXP32:%.*]])
; CHECK-NEXT: [[L3:%.*]] = tail call float @llvm.ldexp.f32.i32(float [[L2]], i32 [[EXP32]])
; CHECK-NEXT: [[L5:%.*]] = tail call float @llvm.ldexp.f32.i64(float [[L4]], i64 [[EXP64:%.*]])
; CHECK-NEXT: [[L7:%.*]] = tail call float @llvm.ldexp.f32.i64(float [[L6]], i64 [[EXP64]])
; CHECK-NEXT: store float [[L1]], ptr [[Y:%.*]], align 4
; CHECK-NEXT: [[ARRAYIDX2_1:%.*]] = getelementptr inbounds float, ptr [[Y]], i64 1
; CHECK-NEXT: store float [[L3]], ptr [[ARRAYIDX2_1]], align 4
; CHECK-NEXT: [[ARRAYIDX2_2:%.*]] = getelementptr inbounds float, ptr [[Y]], i64 2
; CHECK-NEXT: store float [[L5]], ptr [[ARRAYIDX2_2]], align 4
; CHECK-NEXT: [[ARRAYIDX2_3:%.*]] = getelementptr inbounds float, ptr [[Y]], i64 3
; CHECK-NEXT: store float [[L7]], ptr [[ARRAYIDX2_3]], align 4
; CHECK-NEXT: ret void
;
entry:
%l0 = load float, ptr %x, align 4
%arrayidx.1 = getelementptr inbounds float, ptr %x, i64 1
%l2 = load float, ptr %arrayidx.1, align 4
%arrayidx.2 = getelementptr inbounds float, ptr %x, i64 2
%l4 = load float, ptr %arrayidx.2, align 4
%arrayidx.3 = getelementptr inbounds float, ptr %x, i64 3
%l6 = load float, ptr %arrayidx.3, align 4
%l1 = tail call float @llvm.ldexp.f32.i32(float %l0, i32 %exp32)
%l3 = tail call float @llvm.ldexp.f32.i32(float %l2, i32 %exp32)
%l5 = tail call float @llvm.ldexp.f32.i64(float %l4, i64 %exp64)
%l7 = tail call float @llvm.ldexp.f32.i64(float %l6, i64 %exp64)
store float %l1, ptr %y, align 4
%arrayidx2.1 = getelementptr inbounds float, ptr %y, i64 1
store float %l3, ptr %arrayidx2.1, align 4
%arrayidx2.2 = getelementptr inbounds float, ptr %y, i64 2
store float %l5, ptr %arrayidx2.2, align 4
%arrayidx2.3 = getelementptr inbounds float, ptr %y, i64 3
store float %l7, ptr %arrayidx2.3, align 4
ret void
}
define void @ldexp_f64_i32_i64(ptr %x, ptr %y, i32 %exp32, i64 %exp64) {
; CHECK-LABEL: @ldexp_f64_i32_i64(
; CHECK-NEXT: entry:
; CHECK-NEXT: [[L0:%.*]] = load double, ptr [[X:%.*]], align 4
; CHECK-NEXT: [[ARRAYIDX_1:%.*]] = getelementptr inbounds double, ptr [[X]], i64 1
; CHECK-NEXT: [[L2:%.*]] = load double, ptr [[ARRAYIDX_1]], align 4
; CHECK-NEXT: [[ARRAYIDX_2:%.*]] = getelementptr inbounds double, ptr [[X]], i64 2
; CHECK-NEXT: [[L4:%.*]] = load double, ptr [[ARRAYIDX_2]], align 4
; CHECK-NEXT: [[ARRAYIDX_3:%.*]] = getelementptr inbounds double, ptr [[X]], i64 3
; CHECK-NEXT: [[L6:%.*]] = load double, ptr [[ARRAYIDX_3]], align 4
; CHECK-NEXT: [[L1:%.*]] = tail call double @llvm.ldexp.f64.i32(double [[L0]], i32 [[EXP32:%.*]])
; CHECK-NEXT: [[L3:%.*]] = tail call double @llvm.ldexp.f64.i32(double [[L2]], i32 [[EXP32]])
; CHECK-NEXT: [[L5:%.*]] = tail call double @llvm.ldexp.f64.i64(double [[L4]], i64 [[EXP64:%.*]])
; CHECK-NEXT: [[L7:%.*]] = tail call double @llvm.ldexp.f64.i64(double [[L6]], i64 [[EXP64]])
; CHECK-NEXT: store double [[L1]], ptr [[Y:%.*]], align 4
; CHECK-NEXT: [[ARRAYIDX2_1:%.*]] = getelementptr inbounds double, ptr [[Y]], i64 1
; CHECK-NEXT: store double [[L3]], ptr [[ARRAYIDX2_1]], align 4
; CHECK-NEXT: [[ARRAYIDX2_2:%.*]] = getelementptr inbounds double, ptr [[Y]], i64 2
; CHECK-NEXT: store double [[L5]], ptr [[ARRAYIDX2_2]], align 4
; CHECK-NEXT: [[ARRAYIDX2_3:%.*]] = getelementptr inbounds double, ptr [[Y]], i64 3
; CHECK-NEXT: store double [[L7]], ptr [[ARRAYIDX2_3]], align 4
; CHECK-NEXT: ret void
;
entry:
%l0 = load double, ptr %x, align 4
%arrayidx.1 = getelementptr inbounds double, ptr %x, i64 1
%l2 = load double, ptr %arrayidx.1, align 4
%arrayidx.2 = getelementptr inbounds double, ptr %x, i64 2
%l4 = load double, ptr %arrayidx.2, align 4
%arrayidx.3 = getelementptr inbounds double, ptr %x, i64 3
%l6 = load double, ptr %arrayidx.3, align 4
%l1 = tail call double @llvm.ldexp.f64.i32(double %l0, i32 %exp32)
%l3 = tail call double @llvm.ldexp.f64.i32(double %l2, i32 %exp32)
%l5 = tail call double @llvm.ldexp.f64.i64(double %l4, i64 %exp64)
%l7 = tail call double @llvm.ldexp.f64.i64(double %l6, i64 %exp64)
store double %l1, ptr %y, align 4
%arrayidx2.1 = getelementptr inbounds double, ptr %y, i64 1
store double %l3, ptr %arrayidx2.1, align 4
%arrayidx2.2 = getelementptr inbounds double, ptr %y, i64 2
store double %l5, ptr %arrayidx2.2, align 4
%arrayidx2.3 = getelementptr inbounds double, ptr %y, i64 3
store double %l7, ptr %arrayidx2.3, align 4
ret void
}
declare float @llvm.ldexp.f32.i32(float, i32)
declare double @llvm.ldexp.f64.i32(double, i32)
declare float @llvm.ldexp.f32.i64(float, i64)
declare double @llvm.ldexp.f64.i64(double, i64)