brintos

brintos / llvm-project-archived public Read only

0
0
Text · 15.7 KiB · b5c9b90 Raw
366 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py2; RUN: llc -mtriple=thumbv8.1m.main-none-none-eabi -mattr=+mve.fp -verify-machineinstrs -arm-memtransfer-tploop=force-enabled %s -o - | FileCheck %s3 4; In this test, the successors of various blocks were becoming invalid after5; ifcvt as the blocks did not properly fall through to the successor after a6; WhileLoopStart7 8@arr_183 = external dso_local local_unnamed_addr global [20 x [23 x [19 x i8]]], align 19define i32 @a(i8 zeroext %b, ptr nocapture readonly %c, ptr nocapture readonly %d) {10; CHECK-LABEL: a:11; CHECK:       @ %bb.0: @ %entry12; CHECK-NEXT:    .save {r4, r5, r7, lr}13; CHECK-NEXT:    push {r4, r5, r7, lr}14; CHECK-NEXT:    cmp r0, #215; CHECK-NEXT:    bls.w .LBB0_1216; CHECK-NEXT:  @ %bb.1: @ %for.body.us.preheader17; CHECK-NEXT:    movw r5, :lower16:arr_18318; CHECK-NEXT:    movs r3, #019; CHECK-NEXT:    movt r5, :upper16:arr_18320; CHECK-NEXT:    mov.w r12, #1921; CHECK-NEXT:    vmov.i32 q0, #0x022; CHECK-NEXT:    vmov.i32 q1, #0x023; CHECK-NEXT:    vmov.i32 q2, #0x024; CHECK-NEXT:    vmov.i32 q3, #0x025; CHECK-NEXT:    b .LBB0_326; CHECK-NEXT:  .LBB0_2: @ %land.end.us.327; CHECK-NEXT:    @ in Loop: Header=BB0_3 Depth=128; CHECK-NEXT:    movs r3, #129; CHECK-NEXT:  .LBB0_3: @ %for.body.us30; CHECK-NEXT:    @ =>This Loop Header: Depth=131; CHECK-NEXT:    @ Child Loop BB0_4 Depth 232; CHECK-NEXT:    @ Child Loop BB0_6 Depth 233; CHECK-NEXT:    @ Child Loop BB0_8 Depth 234; CHECK-NEXT:    @ Child Loop BB0_11 Depth 235; CHECK-NEXT:    ldr.w r0, [r2, r3, lsl #2]36; CHECK-NEXT:    cmp r0, #037; CHECK-NEXT:    ite ne38; CHECK-NEXT:    ldrbne r0, [r1, r3]39; CHECK-NEXT:    moveq r0, #040; CHECK-NEXT:    mla r3, r3, r12, r541; CHECK-NEXT:    add r3, r042; CHECK-NEXT:    rsb.w r0, r0, #10843; CHECK-NEXT:    wlstp.8 lr, r0, .LBB0_544; CHECK-NEXT:  .LBB0_4: @ Parent Loop BB0_3 Depth=145; CHECK-NEXT:    @ => This Inner Loop Header: Depth=246; CHECK-NEXT:    vstrb.8 q0, [r3], #1647; CHECK-NEXT:    letp lr, .LBB0_448; CHECK-NEXT:  .LBB0_5: @ %land.end.us49; CHECK-NEXT:    @ in Loop: Header=BB0_3 Depth=150; CHECK-NEXT:    ldr r0, [r2, #4]51; CHECK-NEXT:    cmp r0, #052; CHECK-NEXT:    ite ne53; CHECK-NEXT:    ldrbne r0, [r1, #1]54; CHECK-NEXT:    moveq r0, #055; CHECK-NEXT:    adds r3, r5, r056; CHECK-NEXT:    rsb.w r0, r0, #10857; CHECK-NEXT:    adds r3, #1958; CHECK-NEXT:    wlstp.8 lr, r0, .LBB0_759; CHECK-NEXT:  .LBB0_6: @ Parent Loop BB0_3 Depth=160; CHECK-NEXT:    @ => This Inner Loop Header: Depth=261; CHECK-NEXT:    vstrb.8 q1, [r3], #1662; CHECK-NEXT:    letp lr, .LBB0_663; CHECK-NEXT:  .LBB0_7: @ %land.end.us.164; CHECK-NEXT:    @ in Loop: Header=BB0_3 Depth=165; CHECK-NEXT:    ldr r0, [r2, #4]66; CHECK-NEXT:    cmp r0, #067; CHECK-NEXT:    ite ne68; CHECK-NEXT:    ldrbne r0, [r1, #1]69; CHECK-NEXT:    moveq r0, #070; CHECK-NEXT:    adds r3, r5, r071; CHECK-NEXT:    rsb.w r0, r0, #10872; CHECK-NEXT:    adds r3, #1973; CHECK-NEXT:    wlstp.8 lr, r0, .LBB0_974; CHECK-NEXT:  .LBB0_8: @ Parent Loop BB0_3 Depth=175; CHECK-NEXT:    @ => This Inner Loop Header: Depth=276; CHECK-NEXT:    vstrb.8 q2, [r3], #1677; CHECK-NEXT:    letp lr, .LBB0_878; CHECK-NEXT:  .LBB0_9: @ %land.end.us.279; CHECK-NEXT:    @ in Loop: Header=BB0_3 Depth=180; CHECK-NEXT:    ldr r0, [r2, #4]81; CHECK-NEXT:    cmp r0, #082; CHECK-NEXT:    ite ne83; CHECK-NEXT:    ldrbne r0, [r1, #1]84; CHECK-NEXT:    moveq r0, #085; CHECK-NEXT:    adds r3, r5, r086; CHECK-NEXT:    rsb.w r0, r0, #10887; CHECK-NEXT:    add.w r4, r0, #1588; CHECK-NEXT:    adds r3, #1989; CHECK-NEXT:    lsrs r4, r4, #490; CHECK-NEXT:    cmp.w r4, #091; CHECK-NEXT:    beq .LBB0_292; CHECK-NEXT:  @ %bb.10: @ %land.end.us.293; CHECK-NEXT:    @ in Loop: Header=BB0_3 Depth=194; CHECK-NEXT:    dlstp.8 lr, r095; CHECK-NEXT:  .LBB0_11: @ Parent Loop BB0_3 Depth=196; CHECK-NEXT:    @ => This Inner Loop Header: Depth=297; CHECK-NEXT:    vstrb.8 q3, [r3], #1698; CHECK-NEXT:    letp lr, .LBB0_1199; CHECK-NEXT:    b .LBB0_2100; CHECK-NEXT:  .LBB0_12:101; CHECK-NEXT:    movw r12, :lower16:arr_183102; CHECK-NEXT:    vmov.i32 q0, #0x0103; CHECK-NEXT:    movt r12, :upper16:arr_183104; CHECK-NEXT:    vmov.i32 q1, #0x0105; CHECK-NEXT:    vmov.i32 q2, #0x0106; CHECK-NEXT:    vmov.i32 q3, #0x0107; CHECK-NEXT:    b .LBB0_14108; CHECK-NEXT:  .LBB0_13: @ %for.body.lr.ph.3109; CHECK-NEXT:    @ in Loop: Header=BB0_14 Depth=1110; CHECK-NEXT:    ldr r3, [r2, #4]111; CHECK-NEXT:    cmp r3, #0112; CHECK-NEXT:    ite ne113; CHECK-NEXT:    ldrbne r3, [r1, #1]114; CHECK-NEXT:    moveq r3, #0115; CHECK-NEXT:    add.w r5, r12, r3116; CHECK-NEXT:    rsb.w r3, r3, #108117; CHECK-NEXT:    add.w r4, r5, #19118; CHECK-NEXT:    wlstp.8 lr, r3, .LBB0_14119; CHECK-NEXT:    b .LBB0_24120; CHECK-NEXT:  .LBB0_14: @ %for.cond121; CHECK-NEXT:    @ =>This Loop Header: Depth=1122; CHECK-NEXT:    @ Child Loop BB0_16 Depth 2123; CHECK-NEXT:    @ Child Loop BB0_19 Depth 2124; CHECK-NEXT:    @ Child Loop BB0_22 Depth 2125; CHECK-NEXT:    @ Child Loop BB0_24 Depth 2126; CHECK-NEXT:    cmp r0, #2127; CHECK-NEXT:    blo .LBB0_17128; CHECK-NEXT:  @ %bb.15: @ %for.body.lr.ph129; CHECK-NEXT:    @ in Loop: Header=BB0_14 Depth=1130; CHECK-NEXT:    ldr r3, [r2, #4]131; CHECK-NEXT:    cmp r3, #0132; CHECK-NEXT:    ite ne133; CHECK-NEXT:    ldrbne r3, [r1, #1]134; CHECK-NEXT:    moveq r3, #0135; CHECK-NEXT:    add.w r5, r12, r3136; CHECK-NEXT:    rsb.w r3, r3, #108137; CHECK-NEXT:    add.w r4, r5, #19138; CHECK-NEXT:    wlstp.8 lr, r3, .LBB0_17139; CHECK-NEXT:  .LBB0_16: @ Parent Loop BB0_14 Depth=1140; CHECK-NEXT:    @ => This Inner Loop Header: Depth=2141; CHECK-NEXT:    vstrb.8 q0, [r4], #16142; CHECK-NEXT:    letp lr, .LBB0_16143; CHECK-NEXT:  .LBB0_17: @ %for.cond.backedge144; CHECK-NEXT:    @ in Loop: Header=BB0_14 Depth=1145; CHECK-NEXT:    cmp r0, #2146; CHECK-NEXT:    blo .LBB0_20147; CHECK-NEXT:  @ %bb.18: @ %for.body.lr.ph.1148; CHECK-NEXT:    @ in Loop: Header=BB0_14 Depth=1149; CHECK-NEXT:    ldr r3, [r2, #4]150; CHECK-NEXT:    cmp r3, #0151; CHECK-NEXT:    ite ne152; CHECK-NEXT:    ldrbne r3, [r1, #1]153; CHECK-NEXT:    moveq r3, #0154; CHECK-NEXT:    add.w r5, r12, r3155; CHECK-NEXT:    rsb.w r3, r3, #108156; CHECK-NEXT:    add.w r4, r5, #19157; CHECK-NEXT:    wlstp.8 lr, r3, .LBB0_20158; CHECK-NEXT:  .LBB0_19: @ Parent Loop BB0_14 Depth=1159; CHECK-NEXT:    @ => This Inner Loop Header: Depth=2160; CHECK-NEXT:    vstrb.8 q1, [r4], #16161; CHECK-NEXT:    letp lr, .LBB0_19162; CHECK-NEXT:  .LBB0_20: @ %for.cond.backedge.1163; CHECK-NEXT:    @ in Loop: Header=BB0_14 Depth=1164; CHECK-NEXT:    cmp r0, #2165; CHECK-NEXT:    blo .LBB0_23166; CHECK-NEXT:  @ %bb.21: @ %for.body.lr.ph.2167; CHECK-NEXT:    @ in Loop: Header=BB0_14 Depth=1168; CHECK-NEXT:    ldr r3, [r2, #4]169; CHECK-NEXT:    cmp r3, #0170; CHECK-NEXT:    ite ne171; CHECK-NEXT:    ldrbne r3, [r1, #1]172; CHECK-NEXT:    moveq r3, #0173; CHECK-NEXT:    add.w r5, r12, r3174; CHECK-NEXT:    rsb.w r3, r3, #108175; CHECK-NEXT:    add.w r4, r5, #19176; CHECK-NEXT:    wlstp.8 lr, r3, .LBB0_23177; CHECK-NEXT:  .LBB0_22: @ Parent Loop BB0_14 Depth=1178; CHECK-NEXT:    @ => This Inner Loop Header: Depth=2179; CHECK-NEXT:    vstrb.8 q2, [r4], #16180; CHECK-NEXT:    letp lr, .LBB0_22181; CHECK-NEXT:  .LBB0_23: @ %for.cond.backedge.2182; CHECK-NEXT:    @ in Loop: Header=BB0_14 Depth=1183; CHECK-NEXT:    cmp r0, #2184; CHECK-NEXT:    blo .LBB0_14185; CHECK-NEXT:    b .LBB0_13186; CHECK-NEXT:  .LBB0_24: @ Parent Loop BB0_14 Depth=1187; CHECK-NEXT:    @ => This Inner Loop Header: Depth=2188; CHECK-NEXT:    vstrb.8 q3, [r4], #16189; CHECK-NEXT:    letp lr, .LBB0_24190; CHECK-NEXT:    b .LBB0_14191entry:192  %cmp = icmp ugt i8 %b, 2  ; avoid following BB optimizing away through the domination193  br i1 %cmp, label %for.body.us.preheader, label %for.cond.preheader194 195for.cond.preheader:                               ; preds = %entry196  %cmp43 = icmp ugt i8 %b, 1197  %arrayidx6 = getelementptr inbounds [3 x i32], ptr %d, i32 0, i32 1198  %arrayidx12 = getelementptr inbounds [3 x i8], ptr %c, i32 0, i32 1199  %cmp43.1 = icmp ugt i8 %b, 1200  %arrayidx6.1 = getelementptr inbounds [3 x i32], ptr %d, i32 0, i32 1201  %arrayidx12.1 = getelementptr inbounds [3 x i8], ptr %c, i32 0, i32 1202  %cmp43.2 = icmp ugt i8 %b, 1203  %arrayidx6.2 = getelementptr inbounds [3 x i32], ptr %d, i32 0, i32 1204  %arrayidx12.2 = getelementptr inbounds [3 x i8], ptr %c, i32 0, i32 1205  %cmp43.3 = icmp ugt i8 %b, 1206  %arrayidx6.3 = getelementptr inbounds [3 x i32], ptr %d, i32 0, i32 1207  %arrayidx12.3 = getelementptr inbounds [3 x i8], ptr %c, i32 0, i32 1208  br label %for.cond209 210for.body.us.preheader:                            ; preds = %entry211  %arrayidx6.us.1 = getelementptr inbounds [3 x i32], ptr %d, i32 0, i32 1212  %arrayidx12.us.1 = getelementptr inbounds [3 x i8], ptr %c, i32 0, i32 1213  %arrayidx6.us.2 = getelementptr inbounds [3 x i32], ptr %d, i32 0, i32 1214  %arrayidx12.us.2 = getelementptr inbounds [3 x i8], ptr %c, i32 0, i32 1215  %arrayidx6.us.3 = getelementptr inbounds [3 x i32], ptr %d, i32 0, i32 1216  %arrayidx12.us.3 = getelementptr inbounds [3 x i8], ptr %c, i32 0, i32 1217  br label %for.body.us218 219for.cond:                                         ; preds = %for.cond.backedge.3, %for.cond.preheader220  br i1 %cmp43, label %for.body.lr.ph, label %for.cond.backedge221 222for.body.lr.ph:                                   ; preds = %for.cond223  %0 = load i32, ptr %arrayidx6, align 4224  %tobool7.not = icmp eq i32 %0, 0225  br i1 %tobool7.not, label %land.end, label %land.rhs226 227for.body.us:                                      ; preds = %land.end.us.3, %for.body.us.preheader228  %conv44.us = phi i32 [ 0, %for.body.us.preheader ], [ 1, %land.end.us.3 ]229  %arrayidx6.us = getelementptr inbounds [3 x i32], ptr %d, i32 0, i32 %conv44.us230  %1 = load i32, ptr %arrayidx6.us, align 4231  %tobool7.not.us = icmp eq i32 %1, 0232  br i1 %tobool7.not.us, label %land.end.us, label %land.rhs.us233 234land.rhs.us:                                      ; preds = %for.body.us235  %arrayidx12.us = getelementptr inbounds [3 x i8], ptr %c, i32 0, i32 %conv44.us236  %2 = load i8, ptr %arrayidx12.us, align 1237  %tobool13.us = zext i8 %2 to i32238  br label %land.end.us239 240land.end.us:                                      ; preds = %land.rhs.us, %for.body.us241  %3 = phi i32 [ 0, %for.body.us ], [ %tobool13.us, %land.rhs.us ]242  %scevgep45 = getelementptr [20 x [23 x [19 x i8]]], ptr @arr_183, i32 0, i32 0, i32 %conv44.us, i32 %3243  %4 = sub nuw nsw i32 108, %3244  call void @llvm.memset.p0.i32(ptr align 1 %scevgep45, i8 0, i32 %4, i1 false)245  %5 = load i32, ptr %arrayidx6.us.1, align 4246  %tobool7.not.us.1 = icmp eq i32 %5, 0247  br i1 %tobool7.not.us.1, label %land.end.us.1, label %land.rhs.us.1248 249land.rhs:                                         ; preds = %for.body.lr.ph250  %6 = load i8, ptr %arrayidx12, align 1251  %tobool13 = zext i8 %6 to i32252  br label %land.end253 254land.end:                                         ; preds = %land.rhs, %for.body.lr.ph255  %7 = phi i32 [ 0, %for.body.lr.ph ], [ %tobool13, %land.rhs ]256  %scevgep = getelementptr [20 x [23 x [19 x i8]]], ptr @arr_183, i32 0, i32 0, i32 1, i32 %7257  %8 = sub nuw nsw i32 108, %7258  call void @llvm.memset.p0.i32(ptr align 1 %scevgep, i8 0, i32 %8, i1 false)259  br label %for.cond.backedge260 261for.cond.backedge:                                ; preds = %land.end, %for.cond262  br i1 %cmp43.1, label %for.body.lr.ph.1, label %for.cond.backedge.1263 264for.body.lr.ph.1:                                 ; preds = %for.cond.backedge265  %9 = load i32, ptr %arrayidx6.1, align 4266  %tobool7.not.1 = icmp eq i32 %9, 0267  br i1 %tobool7.not.1, label %land.end.1, label %land.rhs.1268 269land.rhs.1:                                       ; preds = %for.body.lr.ph.1270  %10 = load i8, ptr %arrayidx12.1, align 1271  %tobool13.1 = zext i8 %10 to i32272  br label %land.end.1273 274land.end.1:                                       ; preds = %land.rhs.1, %for.body.lr.ph.1275  %11 = phi i32 [ 0, %for.body.lr.ph.1 ], [ %tobool13.1, %land.rhs.1 ]276  %scevgep.1 = getelementptr [20 x [23 x [19 x i8]]], ptr @arr_183, i32 0, i32 0, i32 1, i32 %11277  %12 = sub nuw nsw i32 108, %11278  call void @llvm.memset.p0.i32(ptr align 1 %scevgep.1, i8 0, i32 %12, i1 false)279  br label %for.cond.backedge.1280 281for.cond.backedge.1:                              ; preds = %land.end.1, %for.cond.backedge282  br i1 %cmp43.2, label %for.body.lr.ph.2, label %for.cond.backedge.2283 284for.body.lr.ph.2:                                 ; preds = %for.cond.backedge.1285  %13 = load i32, ptr %arrayidx6.2, align 4286  %tobool7.not.2 = icmp eq i32 %13, 0287  br i1 %tobool7.not.2, label %land.end.2, label %land.rhs.2288 289land.rhs.2:                                       ; preds = %for.body.lr.ph.2290  %14 = load i8, ptr %arrayidx12.2, align 1291  %tobool13.2 = zext i8 %14 to i32292  br label %land.end.2293 294land.end.2:                                       ; preds = %land.rhs.2, %for.body.lr.ph.2295  %15 = phi i32 [ 0, %for.body.lr.ph.2 ], [ %tobool13.2, %land.rhs.2 ]296  %scevgep.2 = getelementptr [20 x [23 x [19 x i8]]], ptr @arr_183, i32 0, i32 0, i32 1, i32 %15297  %16 = sub nuw nsw i32 108, %15298  call void @llvm.memset.p0.i32(ptr align 1 %scevgep.2, i8 0, i32 %16, i1 false)299  br label %for.cond.backedge.2300 301for.cond.backedge.2:                              ; preds = %land.end.2, %for.cond.backedge.1302  br i1 %cmp43.3, label %for.body.lr.ph.3, label %for.cond.backedge.3303 304for.body.lr.ph.3:                                 ; preds = %for.cond.backedge.2305  %17 = load i32, ptr %arrayidx6.3, align 4306  %tobool7.not.3 = icmp eq i32 %17, 0307  br i1 %tobool7.not.3, label %land.end.3, label %land.rhs.3308 309land.rhs.3:                                       ; preds = %for.body.lr.ph.3310  %18 = load i8, ptr %arrayidx12.3, align 1311  %tobool13.3 = zext i8 %18 to i32312  br label %land.end.3313 314land.end.3:                                       ; preds = %land.rhs.3, %for.body.lr.ph.3315  %19 = phi i32 [ 0, %for.body.lr.ph.3 ], [ %tobool13.3, %land.rhs.3 ]316  %scevgep.3 = getelementptr [20 x [23 x [19 x i8]]], ptr @arr_183, i32 0, i32 0, i32 1, i32 %19317  %20 = sub nuw nsw i32 108, %19318  call void @llvm.memset.p0.i32(ptr align 1 %scevgep.3, i8 0, i32 %20, i1 false)319  br label %for.cond.backedge.3320 321for.cond.backedge.3:                              ; preds = %land.end.3, %for.cond.backedge.2322  br label %for.cond323 324land.rhs.us.1:                                    ; preds = %land.end.us325  %21 = load i8, ptr %arrayidx12.us.1, align 1326  %tobool13.us.1 = zext i8 %21 to i32327  br label %land.end.us.1328 329land.end.us.1:                                    ; preds = %land.rhs.us.1, %land.end.us330  %22 = phi i32 [ 0, %land.end.us ], [ %tobool13.us.1, %land.rhs.us.1 ]331  %scevgep45.1 = getelementptr [20 x [23 x [19 x i8]]], ptr @arr_183, i32 0, i32 0, i32 1, i32 %22332  %23 = sub nuw nsw i32 108, %22333  call void @llvm.memset.p0.i32(ptr align 1 %scevgep45.1, i8 0, i32 %23, i1 false)334  %24 = load i32, ptr %arrayidx6.us.2, align 4335  %tobool7.not.us.2 = icmp eq i32 %24, 0336  br i1 %tobool7.not.us.2, label %land.end.us.2, label %land.rhs.us.2337 338land.rhs.us.2:                                    ; preds = %land.end.us.1339  %25 = load i8, ptr %arrayidx12.us.2, align 1340  %tobool13.us.2 = zext i8 %25 to i32341  br label %land.end.us.2342 343land.end.us.2:                                    ; preds = %land.rhs.us.2, %land.end.us.1344  %26 = phi i32 [ 0, %land.end.us.1 ], [ %tobool13.us.2, %land.rhs.us.2 ]345  %scevgep45.2 = getelementptr [20 x [23 x [19 x i8]]], ptr @arr_183, i32 0, i32 0, i32 1, i32 %26346  %27 = sub nuw nsw i32 108, %26347  call void @llvm.memset.p0.i32(ptr align 1 %scevgep45.2, i8 0, i32 %27, i1 false)348  %28 = load i32, ptr %arrayidx6.us.3, align 4349  %tobool7.not.us.3 = icmp eq i32 %28, 0350  br i1 %tobool7.not.us.3, label %land.end.us.3, label %land.rhs.us.3351 352land.rhs.us.3:                                    ; preds = %land.end.us.2353  %29 = load i8, ptr %arrayidx12.us.3, align 1354  %tobool13.us.3 = zext i8 %29 to i32355  br label %land.end.us.3356 357land.end.us.3:                                    ; preds = %land.rhs.us.3, %land.end.us.2358  %30 = phi i32 [ 0, %land.end.us.2 ], [ %tobool13.us.3, %land.rhs.us.3 ]359  %scevgep45.3 = getelementptr [20 x [23 x [19 x i8]]], ptr @arr_183, i32 0, i32 0, i32 1, i32 %30360  %31 = sub nuw nsw i32 108, %30361  call void @llvm.memset.p0.i32(ptr align 1 %scevgep45.3, i8 0, i32 %31, i1 false)362  br label %for.body.us363}364 365declare void @llvm.memset.p0.i32(ptr, i8, i32, i1)366