brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.4 KiB · 1e8ba61 Raw
76 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py2; RUN: opt -passes=ipsccp -S %s | FileCheck %s3 4declare noalias ptr @malloc(i64)5 6; Make sure we can eliminate `%tmp17 = icmp ult i32 %tmp10, 3`.7 8declare void @use(i1)9 10define internal ptr @spam(ptr %arg) {11; CHECK-LABEL: @spam(12; CHECK-NEXT:  bb:13; CHECK-NEXT:    [[TMP:%.*]] = call ptr @malloc(i64 10368)14; CHECK-NEXT:    [[TMP5:%.*]] = load i32, ptr [[ARG:%.*]], align 815; CHECK-NEXT:    [[TMP6:%.*]] = add i32 [[TMP5]], 116; CHECK-NEXT:    [[TMP7:%.*]] = getelementptr inbounds nuw i32, ptr [[ARG]], i32 117; CHECK-NEXT:    [[TMP10:%.*]] = icmp ne ptr [[TMP7]], null18; CHECK-NEXT:    br i1 [[TMP10]], label [[BB17:%.*]], label [[BB13:%.*]]19; CHECK:       bb13:20; CHECK-NEXT:    [[TMP14:%.*]] = getelementptr inbounds nuw i32, ptr [[ARG]], i32 221; CHECK-NEXT:    [[TMP15:%.*]] = load i32, ptr [[TMP14]], align 822; CHECK-NEXT:    [[TMP16:%.*]] = add i32 [[TMP15]], 123; CHECK-NEXT:    br label [[BB30:%.*]]24; CHECK:       bb17:25; CHECK-NEXT:    [[TMP18:%.*]] = icmp eq i32 [[TMP6]], [[TMP5]]26; CHECK-NEXT:    [[TMP19:%.*]] = getelementptr inbounds nuw i32, ptr [[ARG]], i32 327; CHECK-NEXT:    [[TMP20:%.*]] = load i32, ptr [[TMP19]], align 828; CHECK-NEXT:    br i1 [[TMP18]], label [[BB30]], label [[BB13]]29; CHECK:       bb30:30; CHECK-NEXT:    ret ptr [[TMP]]31;32bb:33  %tmp = call ptr @malloc(i64 10368)34  %tmp5 = load i32, ptr %arg, align 835  %tmp6 = add i32 %tmp5, 136  %tmp7 = getelementptr inbounds i32, ptr %arg, i32 137  %tmp10 = icmp ne ptr %tmp7, null38  br i1 %tmp10, label %bb17, label %bb1339 40bb13:41  %tmp14 = getelementptr inbounds i32, ptr %arg, i32 242  %tmp15 = load i32, ptr %tmp14, align 843  %tmp16 = add i32 %tmp15, 144  br label %bb3045 46bb17:47  %tmp18 = icmp eq i32 %tmp6, %tmp548  %tmp19 = getelementptr inbounds i32, ptr %arg, i32 349  %tmp20 = load i32, ptr %tmp19, align 850  br i1 %tmp18, label %bb30, label %bb1351 52bb30:53  ret ptr %tmp54}55 56define void @spam.1(ptr %arg) {57bb:58  %tmp = alloca ptr, align 859  %tmp4 = call ptr @spam(ptr %arg)60  br label %bb661 62bb6:                                              ; preds = %bb563  %tmp7 = getelementptr inbounds i32, ptr %tmp4, i32 164  %tmp10 = load i32, ptr %tmp7, align 865  %tmp11 = icmp ne i32 %tmp10, 066  br i1 %tmp11, label %bb6, label %bb1567 68bb15:                                             ; preds = %bb1269  %tmp17 = icmp ult i32 %tmp10, 370  call void @use(i1 %tmp17)71  br i1 %tmp17, label %bb6, label %bb2472 73bb24:74  ret void75}76