brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.0 KiB · 05d8192 Raw
59 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py2; RUN: opt -passes=dse -S %s | FileCheck %s3 4declare i1 @cond() readnone5 6define i32 @test() {7; CHECK-LABEL: @test(8; CHECK-NEXT:  entry:9; CHECK-NEXT:    [[M0:%.*]] = alloca [4 x i32], align 1610; CHECK-NEXT:    br label [[LOOP_1:%.*]]11; CHECK:       loop.1:12; CHECK-NEXT:    br label [[LOOP_2:%.*]]13; CHECK:       loop.2:14; CHECK-NEXT:    [[IV:%.*]] = phi i64 [ 0, [[LOOP_1]] ], [ [[IV_NEXT:%.*]], [[LOOP_2]] ]15; CHECK-NEXT:    [[PTR_1:%.*]] = getelementptr inbounds [4 x i32], ptr [[M0]], i64 3, i64 [[IV]]16; CHECK-NEXT:    [[PTR_2:%.*]] = getelementptr inbounds [4 x i32], ptr [[M0]], i64 0, i64 [[IV]]17; CHECK-NEXT:    store i32 20, ptr [[PTR_2]], align 418; CHECK-NEXT:    store i32 30, ptr [[PTR_1]], align 419; CHECK-NEXT:    [[IV_NEXT]] = add nuw nsw i64 [[IV]], 120; CHECK-NEXT:    [[C_3:%.*]] = call i1 @cond()21; CHECK-NEXT:    br i1 [[C_3]], label [[LOOP_1_LATCH:%.*]], label [[LOOP_2]]22; CHECK:       loop.1.latch:23; CHECK-NEXT:    [[C_2:%.*]] = call i1 @cond()24; CHECK-NEXT:    br i1 [[C_2]], label [[EXIT:%.*]], label [[LOOP_1]]25; CHECK:       exit:26; CHECK-NEXT:    [[PTR_3:%.*]] = getelementptr inbounds [4 x i32], ptr [[M0]], i64 0, i64 127; CHECK-NEXT:    [[LV:%.*]] = load i32, ptr [[PTR_3]], align 1628; CHECK-NEXT:    ret i32 [[LV]]29;30entry:31  %M0 = alloca [4 x i32], align 1632  br label %loop.133 34loop.1:35  br label %loop.236 37loop.2:38  %iv = phi i64 [ 0, %loop.1 ], [ %iv.next, %loop.2 ]39  %ptr.1 = getelementptr inbounds [4 x i32], ptr %M0, i64 3, i64 %iv40  store i32 10, ptr %ptr.1, align 441  %ptr.2 = getelementptr inbounds [4 x i32], ptr %M0, i64 0, i64 %iv42  store i32 20, ptr %ptr.2, align 443  store i32 30, ptr %ptr.1, align 444  %iv.next = add nuw nsw i64 %iv, 145  %c.3 = call i1 @cond()46  br i1 %c.3, label %loop.1.latch, label %loop.247 48loop.1.latch:49  %c.2 = call i1 @cond()50  br i1 %c.2, label %exit, label %loop.151 52exit:53  %ptr.3 = getelementptr inbounds [4 x i32], ptr %M0, i64 0, i64 154  %lv = load i32, ptr %ptr.3, align 1655  ret i32 %lv56 57 58}59