63 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 22; RUN: opt -passes=slp-vectorizer -mtriple=arm64-apple-macosx -S %s | FileCheck %s3 4declare float @llvm.maximumnum.f32(float, float)5declare float @llvm.minimumnum.f32(float, float)6 7; TODO: Need reduction version of maximumnum/minimumnum.8define float @reduction_v4f32_maximumnum(ptr %p) {9; CHECK-LABEL: define float @reduction_v4f32_maximumnum10; CHECK-SAME: (ptr [[P:%.*]]) {11; CHECK-NEXT: [[G1:%.*]] = getelementptr inbounds float, ptr [[P]], i64 112; CHECK-NEXT: [[G2:%.*]] = getelementptr inbounds float, ptr [[P]], i64 213; CHECK-NEXT: [[G3:%.*]] = getelementptr inbounds float, ptr [[P]], i64 314; CHECK-NEXT: [[T0:%.*]] = load float, ptr [[P]], align 415; CHECK-NEXT: [[T1:%.*]] = load float, ptr [[G1]], align 416; CHECK-NEXT: [[T2:%.*]] = load float, ptr [[G2]], align 417; CHECK-NEXT: [[T3:%.*]] = load float, ptr [[G3]], align 418; CHECK-NEXT: [[M1:%.*]] = tail call float @llvm.maximumnum.f32(float [[T1]], float [[T0]])19; CHECK-NEXT: [[M2:%.*]] = tail call float @llvm.maximumnum.f32(float [[T2]], float [[M1]])20; CHECK-NEXT: [[M3:%.*]] = tail call float @llvm.maximumnum.f32(float [[T3]], float [[M2]])21; CHECK-NEXT: ret float [[M3]]22;23 %g1 = getelementptr inbounds float, ptr %p, i64 124 %g2 = getelementptr inbounds float, ptr %p, i64 225 %g3 = getelementptr inbounds float, ptr %p, i64 326 %t0 = load float, ptr %p, align 427 %t1 = load float, ptr %g1, align 428 %t2 = load float, ptr %g2, align 429 %t3 = load float, ptr %g3, align 430 %m1 = tail call float @llvm.maximumnum.f32(float %t1, float %t0)31 %m2 = tail call float @llvm.maximumnum.f32(float %t2, float %m1)32 %m3 = tail call float @llvm.maximumnum.f32(float %t3, float %m2)33 ret float %m334}35 36define float @reduction_v4f64_minimumnum(ptr %p) {37; CHECK-LABEL: define float @reduction_v4f64_minimumnum38; CHECK-SAME: (ptr [[P:%.*]]) {39; CHECK-NEXT: [[G1:%.*]] = getelementptr inbounds float, ptr [[P]], i64 140; CHECK-NEXT: [[G2:%.*]] = getelementptr inbounds float, ptr [[P]], i64 241; CHECK-NEXT: [[G3:%.*]] = getelementptr inbounds float, ptr [[P]], i64 342; CHECK-NEXT: [[T0:%.*]] = load float, ptr [[P]], align 443; CHECK-NEXT: [[T1:%.*]] = load float, ptr [[G1]], align 444; CHECK-NEXT: [[T2:%.*]] = load float, ptr [[G2]], align 445; CHECK-NEXT: [[T3:%.*]] = load float, ptr [[G3]], align 446; CHECK-NEXT: [[M1:%.*]] = tail call float @llvm.minimumnum.f32(float [[T1]], float [[T0]])47; CHECK-NEXT: [[M2:%.*]] = tail call float @llvm.minimumnum.f32(float [[T2]], float [[M1]])48; CHECK-NEXT: [[M3:%.*]] = tail call float @llvm.minimumnum.f32(float [[T3]], float [[M2]])49; CHECK-NEXT: ret float [[M3]]50;51 %g1 = getelementptr inbounds float, ptr %p, i64 152 %g2 = getelementptr inbounds float, ptr %p, i64 253 %g3 = getelementptr inbounds float, ptr %p, i64 354 %t0 = load float, ptr %p, align 455 %t1 = load float, ptr %g1, align 456 %t2 = load float, ptr %g2, align 457 %t3 = load float, ptr %g3, align 458 %m1 = tail call float @llvm.minimumnum.f32(float %t1, float %t0)59 %m2 = tail call float @llvm.minimumnum.f32(float %t2, float %m1)60 %m3 = tail call float @llvm.minimumnum.f32(float %t3, float %m2)61 ret float %m362}63