brintos

brintos / llvm-project-archived public Read only

0
0
Text · 7.5 KiB · b8cc896 Raw
119 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py2; RUN: opt -select-optimize -mtriple=aarch64-linux-gnu -mcpu=neoverse-v2 -S < %s | FileCheck %s3; RUN: opt -passes='require<profile-summary>,function(select-optimize)' -mtriple=aarch64-linux-gnu -mcpu=neoverse-v2 -S < %s | FileCheck %s4 5define i32 @test(ptr nocapture noundef readnone %x, i32 noundef %iters) {6; CHECK-LABEL: @test(7; CHECK-NEXT:  entry:8; CHECK-NEXT:    [[CMP3:%.*]] = icmp sgt i32 [[ITERS:%.*]], 09; CHECK-NEXT:    br i1 [[CMP3]], label [[FOR_BODY_I_PREHEADER:%.*]], label [[FOR_COND_CLEANUP:%.*]]10; CHECK:       for.body.i.preheader:11; CHECK-NEXT:    [[I_05:%.*]] = phi i32 [ [[INC:%.*]], [[INNER_LOOP_010_EXIT:%.*]] ], [ 0, [[ENTRY:%.*]] ]12; CHECK-NEXT:    [[RES_04:%.*]] = phi i32 [ [[OR:%.*]], [[INNER_LOOP_010_EXIT]] ], [ 0, [[ENTRY]] ]13; CHECK-NEXT:    br label [[FOR_BODY_I:%.*]]14; CHECK:       for.cond.cleanup:15; CHECK-NEXT:    [[RES_0_LCSSA:%.*]] = phi i32 [ 0, [[ENTRY]] ], [ [[OR]], [[INNER_LOOP_010_EXIT]] ]16; CHECK-NEXT:    ret i32 [[RES_0_LCSSA]]17; CHECK:       for.body.i:18; CHECK-NEXT:    [[INDVARS_IV_I:%.*]] = phi i64 [ 0, [[FOR_BODY_I_PREHEADER]] ], [ [[INDVARS_IV_NEXT_I_4:%.*]], [[FOR_BODY_I]] ]19; CHECK-NEXT:    [[ALL_0_OFF010_I:%.*]] = phi i1 [ true, [[FOR_BODY_I_PREHEADER]] ], [ [[ALL_0_OFF0__I_4:%.*]], [[FOR_BODY_I]] ]20; CHECK-NEXT:    [[ANY_0_OFF09_I:%.*]] = phi i1 [ false, [[FOR_BODY_I_PREHEADER]] ], [ [[DOTANY_0_OFF0_I_4:%.*]], [[FOR_BODY_I]] ]21; CHECK-NEXT:    [[ARRAYIDX_I:%.*]] = getelementptr inbounds float, ptr [[X:%.*]], i64 [[INDVARS_IV_I]]22; CHECK-NEXT:    [[TMP0:%.*]] = load float, ptr [[ARRAYIDX_I]], align 423; CHECK-NEXT:    [[CMP1_I:%.*]] = fcmp fast olt float [[TMP0]], 0.000000e+0024; CHECK-NEXT:    [[INDVARS_IV_NEXT_I:%.*]] = add nuw nsw i64 [[INDVARS_IV_I]], 125; CHECK-NEXT:    [[ARRAYIDX_I_1:%.*]] = getelementptr inbounds float, ptr [[X]], i64 [[INDVARS_IV_NEXT_I]]26; CHECK-NEXT:    [[TMP1:%.*]] = load float, ptr [[ARRAYIDX_I_1]], align 427; CHECK-NEXT:    [[CMP1_I_1:%.*]] = fcmp fast olt float [[TMP1]], 0.000000e+0028; CHECK-NEXT:    [[INDVARS_IV_NEXT_I_1:%.*]] = add nuw nsw i64 [[INDVARS_IV_I]], 229; CHECK-NEXT:    [[ARRAYIDX_I_2:%.*]] = getelementptr inbounds float, ptr [[X]], i64 [[INDVARS_IV_NEXT_I_1]]30; CHECK-NEXT:    [[TMP2:%.*]] = load float, ptr [[ARRAYIDX_I_2]], align 431; CHECK-NEXT:    [[CMP1_I_2:%.*]] = fcmp fast olt float [[TMP2]], 0.000000e+0032; CHECK-NEXT:    [[INDVARS_IV_NEXT_I_2:%.*]] = add nuw nsw i64 [[INDVARS_IV_I]], 333; CHECK-NEXT:    [[ARRAYIDX_I_3:%.*]] = getelementptr inbounds float, ptr [[X]], i64 [[INDVARS_IV_NEXT_I_2]]34; CHECK-NEXT:    [[TMP3:%.*]] = load float, ptr [[ARRAYIDX_I_3]], align 435; CHECK-NEXT:    [[CMP1_I_3:%.*]] = fcmp fast olt float [[TMP3]], 0.000000e+0036; CHECK-NEXT:    [[INDVARS_IV_NEXT_I_3:%.*]] = add nuw nsw i64 [[INDVARS_IV_I]], 437; CHECK-NEXT:    [[ARRAYIDX_I_4:%.*]] = getelementptr inbounds float, ptr [[X]], i64 [[INDVARS_IV_NEXT_I_3]]38; CHECK-NEXT:    [[TMP4:%.*]] = load float, ptr [[ARRAYIDX_I_4]], align 439; CHECK-NEXT:    [[CMP1_I_4:%.*]] = fcmp fast olt float [[TMP4]], 0.000000e+0040; CHECK-NEXT:    [[TMP5:%.*]] = select i1 [[CMP1_I_4]], i1 true, i1 [[CMP1_I_3]]41; CHECK-NEXT:    [[TMP6:%.*]] = select i1 [[TMP5]], i1 true, i1 [[CMP1_I_2]]42; CHECK-NEXT:    [[TMP7:%.*]] = select i1 [[TMP6]], i1 true, i1 [[CMP1_I_1]]43; CHECK-NEXT:    [[TMP8:%.*]] = select i1 [[TMP7]], i1 true, i1 [[CMP1_I]]44; CHECK-NEXT:    [[DOTANY_0_OFF0_I_4]] = select i1 [[TMP8]], i1 true, i1 [[ANY_0_OFF09_I]]45; CHECK-NEXT:    [[TMP9:%.*]] = select i1 [[CMP1_I_4]], i1 [[CMP1_I_3]], i1 false46; CHECK-NEXT:    [[TMP10:%.*]] = select i1 [[TMP9]], i1 [[CMP1_I_2]], i1 false47; CHECK-NEXT:    [[TMP11:%.*]] = select i1 [[TMP10]], i1 [[CMP1_I_1]], i1 false48; CHECK-NEXT:    [[TMP12:%.*]] = select i1 [[TMP11]], i1 [[CMP1_I]], i1 false49; CHECK-NEXT:    [[ALL_0_OFF0__I_4]] = select i1 [[TMP12]], i1 [[ALL_0_OFF010_I]], i1 false50; CHECK-NEXT:    [[INDVARS_IV_NEXT_I_4]] = add nuw nsw i64 [[INDVARS_IV_I]], 551; CHECK-NEXT:    [[EXITCOND_NOT_I_4:%.*]] = icmp eq i64 [[INDVARS_IV_NEXT_I_4]], 1000052; CHECK-NEXT:    br i1 [[EXITCOND_NOT_I_4]], label [[INNER_LOOP_010_EXIT]], label [[FOR_BODY_I]]53; CHECK:       inner_loop_010.exit:54; CHECK-NEXT:    [[TMP13:%.*]] = select i1 [[DOTANY_0_OFF0_I_4]], i32 2, i32 355; CHECK-NEXT:    [[TMP14:%.*]] = select i1 [[ALL_0_OFF0__I_4]], i32 1, i32 [[TMP13]]56; CHECK-NEXT:    [[OR]] = or i32 [[TMP14]], [[RES_04]]57; CHECK-NEXT:    [[INC]] = add nuw nsw i32 [[I_05]], 158; CHECK-NEXT:    [[EXITCOND_NOT:%.*]] = icmp eq i32 [[INC]], [[ITERS]]59; CHECK-NEXT:    br i1 [[EXITCOND_NOT]], label [[FOR_COND_CLEANUP]], label [[FOR_BODY_I_PREHEADER]]60;61entry:62  %cmp3 = icmp sgt i32 %iters, 063  br i1 %cmp3, label %for.body.i.preheader, label %for.cond.cleanup64 65for.body.i.preheader:                             ; preds = %entry, %inner_loop_010.exit66  %i.05 = phi i32 [ %inc, %inner_loop_010.exit ], [ 0, %entry ]67  %res.04 = phi i32 [ %or, %inner_loop_010.exit ], [ 0, %entry ]68  br label %for.body.i69 70for.cond.cleanup:                                 ; preds = %inner_loop_010.exit, %entry71  %res.0.lcssa = phi i32 [ 0, %entry ], [ %or, %inner_loop_010.exit ]72  ret i32 %res.0.lcssa73 74for.body.i:                                       ; preds = %for.body.i, %for.body.i.preheader75  %indvars.iv.i = phi i64 [ 0, %for.body.i.preheader ], [ %indvars.iv.next.i.4, %for.body.i ]76  %all.0.off010.i = phi i1 [ true, %for.body.i.preheader ], [ %all.0.off0..i.4, %for.body.i ]77  %any.0.off09.i = phi i1 [ false, %for.body.i.preheader ], [ %.any.0.off0.i.4, %for.body.i ]78  %arrayidx.i = getelementptr inbounds float, ptr %x, i64 %indvars.iv.i79  %0 = load float, ptr %arrayidx.i, align 480  %cmp1.i = fcmp fast olt float %0, 0.000000e+0081  %indvars.iv.next.i = add nuw nsw i64 %indvars.iv.i, 182  %arrayidx.i.1 = getelementptr inbounds float, ptr %x, i64 %indvars.iv.next.i83  %1 = load float, ptr %arrayidx.i.1, align 484  %cmp1.i.1 = fcmp fast olt float %1, 0.000000e+0085  %indvars.iv.next.i.1 = add nuw nsw i64 %indvars.iv.i, 286  %arrayidx.i.2 = getelementptr inbounds float, ptr %x, i64 %indvars.iv.next.i.187  %2 = load float, ptr %arrayidx.i.2, align 488  %cmp1.i.2 = fcmp fast olt float %2, 0.000000e+0089  %indvars.iv.next.i.2 = add nuw nsw i64 %indvars.iv.i, 390  %arrayidx.i.3 = getelementptr inbounds float, ptr %x, i64 %indvars.iv.next.i.291  %3 = load float, ptr %arrayidx.i.3, align 492  %cmp1.i.3 = fcmp fast olt float %3, 0.000000e+0093  %indvars.iv.next.i.3 = add nuw nsw i64 %indvars.iv.i, 494  %arrayidx.i.4 = getelementptr inbounds float, ptr %x, i64 %indvars.iv.next.i.395  %4 = load float, ptr %arrayidx.i.4, align 496  %cmp1.i.4 = fcmp fast olt float %4, 0.000000e+0097  %5 = select i1 %cmp1.i.4, i1 true, i1 %cmp1.i.398  %6 = select i1 %5, i1 true, i1 %cmp1.i.299  %7 = select i1 %6, i1 true, i1 %cmp1.i.1100  %8 = select i1 %7, i1 true, i1 %cmp1.i101  %.any.0.off0.i.4 = select i1 %8, i1 true, i1 %any.0.off09.i102  %9 = select i1 %cmp1.i.4, i1 %cmp1.i.3, i1 false103  %10 = select i1 %9, i1 %cmp1.i.2, i1 false104  %11 = select i1 %10, i1 %cmp1.i.1, i1 false105  %12 = select i1 %11, i1 %cmp1.i, i1 false106  %all.0.off0..i.4 = select i1 %12, i1 %all.0.off010.i, i1 false107  %indvars.iv.next.i.4 = add nuw nsw i64 %indvars.iv.i, 5108  %exitcond.not.i.4 = icmp eq i64 %indvars.iv.next.i.4, 10000109  br i1 %exitcond.not.i.4, label %inner_loop_010.exit, label %for.body.i110 111inner_loop_010.exit:                              ; preds = %for.body.i112  %13 = select i1 %.any.0.off0.i.4, i32 2, i32 3113  %14 = select i1 %all.0.off0..i.4, i32 1, i32 %13114  %or = or i32 %14, %res.04115  %inc = add nuw nsw i32 %i.05, 1116  %exitcond.not = icmp eq i32 %inc, %iters117  br i1 %exitcond.not, label %for.cond.cleanup, label %for.body.i.preheader118}119