|
| 1 | +; NOTE: Assertions have been autogenerated by utils/update_test_checks.py |
| 2 | +; RUN: opt -S -passes=slp-vectorizer -mtriple=aarch64 < %s | FileCheck %s |
| 3 | + |
| 4 | +target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128" |
| 5 | + |
| 6 | +define void @ldexp_f32i32(ptr %x, ptr %y, i32 %exp, i32 %n) { |
| 7 | +; CHECK-LABEL: @ldexp_f32i32( |
| 8 | +; CHECK-NEXT: entry: |
| 9 | +; CHECK-NEXT: [[L0:%.*]] = load float, ptr [[X:%.*]], align 4 |
| 10 | +; CHECK-NEXT: [[ARRAYIDX_1:%.*]] = getelementptr inbounds float, ptr [[X]], i64 1 |
| 11 | +; CHECK-NEXT: [[L2:%.*]] = load float, ptr [[ARRAYIDX_1]], align 4 |
| 12 | +; CHECK-NEXT: [[ARRAYIDX_2:%.*]] = getelementptr inbounds float, ptr [[X]], i64 2 |
| 13 | +; CHECK-NEXT: [[L4:%.*]] = load float, ptr [[ARRAYIDX_2]], align 4 |
| 14 | +; CHECK-NEXT: [[ARRAYIDX_3:%.*]] = getelementptr inbounds float, ptr [[X]], i64 3 |
| 15 | +; CHECK-NEXT: [[L6:%.*]] = load float, ptr [[ARRAYIDX_3]], align 4 |
| 16 | +; CHECK-NEXT: [[L1:%.*]] = tail call float @llvm.ldexp.f32.i32(float [[L0]], i32 [[EXP:%.*]]) |
| 17 | +; CHECK-NEXT: [[L3:%.*]] = tail call float @llvm.ldexp.f32.i32(float [[L2]], i32 [[EXP]]) |
| 18 | +; CHECK-NEXT: [[L5:%.*]] = tail call float @llvm.ldexp.f32.i32(float [[L4]], i32 [[EXP]]) |
| 19 | +; CHECK-NEXT: [[L7:%.*]] = tail call float @llvm.ldexp.f32.i32(float [[L6]], i32 [[EXP]]) |
| 20 | +; CHECK-NEXT: store float [[L1]], ptr [[Y:%.*]], align 4 |
| 21 | +; CHECK-NEXT: [[ARRAYIDX2_1:%.*]] = getelementptr inbounds float, ptr [[Y]], i64 1 |
| 22 | +; CHECK-NEXT: store float [[L3]], ptr [[ARRAYIDX2_1]], align 4 |
| 23 | +; CHECK-NEXT: [[ARRAYIDX2_2:%.*]] = getelementptr inbounds float, ptr [[Y]], i64 2 |
| 24 | +; CHECK-NEXT: store float [[L5]], ptr [[ARRAYIDX2_2]], align 4 |
| 25 | +; CHECK-NEXT: [[ARRAYIDX2_3:%.*]] = getelementptr inbounds float, ptr [[Y]], i64 3 |
| 26 | +; CHECK-NEXT: store float [[L7]], ptr [[ARRAYIDX2_3]], align 4 |
| 27 | +; CHECK-NEXT: ret void |
| 28 | +; |
| 29 | +entry: |
| 30 | + %l0 = load float, ptr %x, align 4 |
| 31 | + %arrayidx.1 = getelementptr inbounds float, ptr %x, i64 1 |
| 32 | + %l2 = load float, ptr %arrayidx.1, align 4 |
| 33 | + %arrayidx.2 = getelementptr inbounds float, ptr %x, i64 2 |
| 34 | + %l4 = load float, ptr %arrayidx.2, align 4 |
| 35 | + %arrayidx.3 = getelementptr inbounds float, ptr %x, i64 3 |
| 36 | + %l6 = load float, ptr %arrayidx.3, align 4 |
| 37 | + %l1 = tail call float @llvm.ldexp.f32.i32(float %l0, i32 %exp) |
| 38 | + %l3 = tail call float @llvm.ldexp.f32.i32(float %l2, i32 %exp) |
| 39 | + %l5 = tail call float @llvm.ldexp.f32.i32(float %l4, i32 %exp) |
| 40 | + %l7 = tail call float @llvm.ldexp.f32.i32(float %l6, i32 %exp) |
| 41 | + store float %l1, ptr %y, align 4 |
| 42 | + %arrayidx2.1 = getelementptr inbounds float, ptr %y, i64 1 |
| 43 | + store float %l3, ptr %arrayidx2.1, align 4 |
| 44 | + %arrayidx2.2 = getelementptr inbounds float, ptr %y, i64 2 |
| 45 | + store float %l5, ptr %arrayidx2.2, align 4 |
| 46 | + %arrayidx2.3 = getelementptr inbounds float, ptr %y, i64 3 |
| 47 | + store float %l7, ptr %arrayidx2.3, align 4 |
| 48 | + ret void |
| 49 | +} |
| 50 | + |
| 51 | +define void @ldexp_f64i32(ptr %x, ptr %y, i32 %exp, i32 %n) { |
| 52 | +; CHECK-LABEL: @ldexp_f64i32( |
| 53 | +; CHECK-NEXT: entry: |
| 54 | +; CHECK-NEXT: [[L0:%.*]] = load double, ptr [[X:%.*]], align 4 |
| 55 | +; CHECK-NEXT: [[ARRAYIDX_1:%.*]] = getelementptr inbounds double, ptr [[X]], i64 1 |
| 56 | +; CHECK-NEXT: [[L2:%.*]] = load double, ptr [[ARRAYIDX_1]], align 4 |
| 57 | +; CHECK-NEXT: [[ARRAYIDX_2:%.*]] = getelementptr inbounds double, ptr [[X]], i64 2 |
| 58 | +; CHECK-NEXT: [[L4:%.*]] = load double, ptr [[ARRAYIDX_2]], align 4 |
| 59 | +; CHECK-NEXT: [[ARRAYIDX_3:%.*]] = getelementptr inbounds double, ptr [[X]], i64 3 |
| 60 | +; CHECK-NEXT: [[L6:%.*]] = load double, ptr [[ARRAYIDX_3]], align 4 |
| 61 | +; CHECK-NEXT: [[L1:%.*]] = tail call double @llvm.ldexp.f64.i32(double [[L0]], i32 [[EXP:%.*]]) |
| 62 | +; CHECK-NEXT: [[L3:%.*]] = tail call double @llvm.ldexp.f64.i32(double [[L2]], i32 [[EXP]]) |
| 63 | +; CHECK-NEXT: [[L5:%.*]] = tail call double @llvm.ldexp.f64.i32(double [[L4]], i32 [[EXP]]) |
| 64 | +; CHECK-NEXT: [[L7:%.*]] = tail call double @llvm.ldexp.f64.i32(double [[L6]], i32 [[EXP]]) |
| 65 | +; CHECK-NEXT: store double [[L1]], ptr [[Y:%.*]], align 4 |
| 66 | +; CHECK-NEXT: [[ARRAYIDX2_1:%.*]] = getelementptr inbounds double, ptr [[Y]], i64 1 |
| 67 | +; CHECK-NEXT: store double [[L3]], ptr [[ARRAYIDX2_1]], align 4 |
| 68 | +; CHECK-NEXT: [[ARRAYIDX2_2:%.*]] = getelementptr inbounds double, ptr [[Y]], i64 2 |
| 69 | +; CHECK-NEXT: store double [[L5]], ptr [[ARRAYIDX2_2]], align 4 |
| 70 | +; CHECK-NEXT: [[ARRAYIDX2_3:%.*]] = getelementptr inbounds double, ptr [[Y]], i64 3 |
| 71 | +; CHECK-NEXT: store double [[L7]], ptr [[ARRAYIDX2_3]], align 4 |
| 72 | +; CHECK-NEXT: ret void |
| 73 | +; |
| 74 | +entry: |
| 75 | + %l0 = load double, ptr %x, align 4 |
| 76 | + %arrayidx.1 = getelementptr inbounds double, ptr %x, i64 1 |
| 77 | + %l2 = load double, ptr %arrayidx.1, align 4 |
| 78 | + %arrayidx.2 = getelementptr inbounds double, ptr %x, i64 2 |
| 79 | + %l4 = load double, ptr %arrayidx.2, align 4 |
| 80 | + %arrayidx.3 = getelementptr inbounds double, ptr %x, i64 3 |
| 81 | + %l6 = load double, ptr %arrayidx.3, align 4 |
| 82 | + %l1 = tail call double @llvm.ldexp.f64.i32(double %l0, i32 %exp) |
| 83 | + %l3 = tail call double @llvm.ldexp.f64.i32(double %l2, i32 %exp) |
| 84 | + %l5 = tail call double @llvm.ldexp.f64.i32(double %l4, i32 %exp) |
| 85 | + %l7 = tail call double @llvm.ldexp.f64.i32(double %l6, i32 %exp) |
| 86 | + store double %l1, ptr %y, align 4 |
| 87 | + %arrayidx2.1 = getelementptr inbounds double, ptr %y, i64 1 |
| 88 | + store double %l3, ptr %arrayidx2.1, align 4 |
| 89 | + %arrayidx2.2 = getelementptr inbounds double, ptr %y, i64 2 |
| 90 | + store double %l5, ptr %arrayidx2.2, align 4 |
| 91 | + %arrayidx2.3 = getelementptr inbounds double, ptr %y, i64 3 |
| 92 | + store double %l7, ptr %arrayidx2.3, align 4 |
| 93 | + ret void |
| 94 | +} |
| 95 | + |
| 96 | +declare float @llvm.ldexp.f32.i32(float, i32) |
| 97 | +declare double @llvm.ldexp.f64.i32(double, i32) |
0 commit comments