brintos

brintos / llvm-project-archived public Read only

0
0
Text · 3.7 KiB · 9e086dc Raw
91 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py2; RUN: opt -S -passes=slp-vectorizer %s -slp-threshold=-10 | FileCheck %s3target datalayout = "e-m:e-i64:64-i128:128-n32:64-S128"4target triple = "aarch64--linux-gnu"5 6%structA = type { [2 x float] }7 8define void @test1(ptr nocapture readonly %J, i32 %xmin, i32 %ymin) {9; CHECK-LABEL: @test1(10; CHECK-NEXT:  entry:11; CHECK-NEXT:    br label [[FOR_BODY3_LR_PH:%.*]]12; CHECK:       for.body3.lr.ph:13; CHECK-NEXT:    [[CONV5:%.*]] = sitofp i32 [[YMIN:%.*]] to float14; CHECK-NEXT:    [[CONV:%.*]] = sitofp i32 [[XMIN:%.*]] to float15; CHECK-NEXT:    [[TMP0:%.*]] = load float, ptr [[J:%.*]], align 416; CHECK-NEXT:    [[SUB:%.*]] = fsub fast float [[CONV]], [[TMP0]]17; CHECK-NEXT:    [[ARRAYIDX9:%.*]] = getelementptr inbounds [[STRUCTA:%.*]], ptr [[J]], i64 0, i32 0, i64 118; CHECK-NEXT:    [[TMP1:%.*]] = load float, ptr [[ARRAYIDX9]], align 419; CHECK-NEXT:    [[SUB10:%.*]] = fsub fast float [[CONV5]], [[TMP1]]20; CHECK-NEXT:    [[MUL11:%.*]] = fmul fast float [[SUB]], [[SUB]]21; CHECK-NEXT:    [[MUL12:%.*]] = fmul fast float [[SUB10]], [[SUB10]]22; CHECK-NEXT:    [[ADD:%.*]] = fadd fast float [[MUL11]], [[MUL12]]23; CHECK-NEXT:    [[CMP:%.*]] = fcmp oeq float [[ADD]], 0.000000e+0024; CHECK-NEXT:    br i1 [[CMP]], label [[FOR_BODY3_LR_PH]], label [[FOR_END27:%.*]]25; CHECK:       for.end27:26; CHECK-NEXT:    ret void27;28 29entry:30  br label %for.body3.lr.ph31 32for.body3.lr.ph:33  %conv5 = sitofp i32 %ymin to float34  %conv = sitofp i32 %xmin to float35  %0 = load float, ptr %J, align 436  %sub = fsub fast float %conv, %037  %arrayidx9 = getelementptr inbounds %structA, ptr %J, i64 0, i32 0, i64 138  %1 = load float, ptr %arrayidx9, align 439  %sub10 = fsub fast float %conv5, %140  %mul11 = fmul fast float %sub, %sub41  %mul12 = fmul fast float %sub10, %sub1042  %add = fadd fast float %mul11, %mul1243  %cmp = fcmp oeq float %add, 0.000000e+0044  br i1 %cmp, label %for.body3.lr.ph, label %for.end2745 46for.end27:47  ret void48}49 50define void @test2(ptr nocapture readonly %J, i32 %xmin, i32 %ymin) {51; CHECK-LABEL: @test2(52; CHECK-NEXT:  entry:53; CHECK-NEXT:    br label [[FOR_BODY3_LR_PH:%.*]]54; CHECK:       for.body3.lr.ph:55; CHECK-NEXT:    [[CONV5:%.*]] = sitofp i32 [[YMIN:%.*]] to float56; CHECK-NEXT:    [[CONV:%.*]] = sitofp i32 [[XMIN:%.*]] to float57; CHECK-NEXT:    [[TMP0:%.*]] = load float, ptr [[J:%.*]], align 458; CHECK-NEXT:    [[SUB:%.*]] = fsub fast float [[CONV]], [[TMP0]]59; CHECK-NEXT:    [[ARRAYIDX9:%.*]] = getelementptr inbounds [[STRUCTA:%.*]], ptr [[J]], i64 0, i32 0, i64 160; CHECK-NEXT:    [[TMP1:%.*]] = load float, ptr [[ARRAYIDX9]], align 461; CHECK-NEXT:    [[SUB10:%.*]] = fsub fast float [[CONV5]], [[TMP1]]62; CHECK-NEXT:    [[MUL11:%.*]] = fmul fast float [[SUB]], [[SUB]]63; CHECK-NEXT:    [[MUL12:%.*]] = fmul fast float [[SUB10]], [[SUB10]]64; CHECK-NEXT:    [[ADD:%.*]] = fadd fast float [[MUL12]], [[MUL11]]65; CHECK-NEXT:    [[CMP:%.*]] = fcmp oeq float [[ADD]], 0.000000e+0066; CHECK-NEXT:    br i1 [[CMP]], label [[FOR_BODY3_LR_PH]], label [[FOR_END27:%.*]]67; CHECK:       for.end27:68; CHECK-NEXT:    ret void69;70 71entry:72  br label %for.body3.lr.ph73 74for.body3.lr.ph:75  %conv5 = sitofp i32 %ymin to float76  %conv = sitofp i32 %xmin to float77  %0 = load float, ptr %J, align 478  %sub = fsub fast float %conv, %079  %arrayidx9 = getelementptr inbounds %structA, ptr %J, i64 0, i32 0, i64 180  %1 = load float, ptr %arrayidx9, align 481  %sub10 = fsub fast float %conv5, %182  %mul11 = fmul fast float %sub, %sub83  %mul12 = fmul fast float %sub10, %sub1084  %add = fadd fast float %mul12, %mul11         ;;;<---- Operands commuted!!85  %cmp = fcmp oeq float %add, 0.000000e+0086  br i1 %cmp, label %for.body3.lr.ph, label %for.end2787 88for.end27:89  ret void90}91