brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.6 KiB · 388b941 Raw
67 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py2; RUN: opt < %s -passes=newgvn -S | FileCheck %s3target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"4 5@global = common global [1024 x i32] zeroinitializer, align 166 7;; We should be able to prove the equivalence of two of the phis, and then use that to eliminate8;; one set of indexing calculations and a load9 10; Function Attrs: nounwind ssp uwtable11define i32 @bar(i32 %arg, i32 %arg1, i32 %arg2) {12; CHECK-LABEL: @bar(13; CHECK-NEXT:  bb:14; CHECK-NEXT:    br label [[BB3:%.*]]15; CHECK:       bb3:16; CHECK-NEXT:    [[TMP:%.*]] = phi i32 [ [[ARG:%.*]], [[BB:%.*]] ], [ [[TMP15:%.*]], [[BB17:%.*]] ]17; CHECK-NEXT:    [[TMP4:%.*]] = phi i32 [ [[ARG2:%.*]], [[BB]] ], [ [[TMP18:%.*]], [[BB17]] ]18; CHECK-NEXT:    [[TMP6:%.*]] = phi i32 [ 0, [[BB]] ], [ [[TMP14:%.*]], [[BB17]] ]19; CHECK-NEXT:    [[TMP7:%.*]] = sext i32 [[TMP]] to i6420; CHECK-NEXT:    [[TMP8:%.*]] = getelementptr inbounds [1024 x i32], ptr @global, i64 0, i64 [[TMP7]]21; CHECK-NEXT:    [[TMP9:%.*]] = load i32, ptr [[TMP8]], align 422; CHECK-NEXT:    [[TMP10:%.*]] = add nsw i32 [[TMP6]], [[TMP9]]23; CHECK-NEXT:    [[TMP14]] = add nsw i32 [[TMP10]], [[TMP9]]24; CHECK-NEXT:    [[TMP15]] = add nsw i32 [[TMP]], [[ARG1:%.*]]25; CHECK-NEXT:    br label [[BB17]]26; CHECK:       bb17:27; CHECK-NEXT:    [[TMP18]] = add i32 [[TMP4]], -128; CHECK-NEXT:    [[TMP19:%.*]] = icmp ne i32 [[TMP4]], 029; CHECK-NEXT:    br i1 [[TMP19]], label [[BB3]], label [[BB20:%.*]]30; CHECK:       bb20:31; CHECK-NEXT:    ret i32 [[TMP14]]32;33bb:34  br label %bb335 36bb3:                                              ; preds = %bb17, %bb37  %tmp = phi i32 [ %arg, %bb ], [ %tmp15, %bb17 ]38  %tmp4 = phi i32 [ %arg2, %bb ], [ %tmp18, %bb17 ]39  %tmp5 = phi i32 [ %arg, %bb ], [ %tmp16, %bb17 ]40  %tmp6 = phi i32 [ 0, %bb ], [ %tmp14, %bb17 ]41  %tmp7 = sext i32 %tmp to i6442  %tmp8 = getelementptr inbounds [1024 x i32], ptr @global, i64 0, i64 %tmp743  %tmp9 = load i32, ptr %tmp8, align 444  %tmp10 = add nsw i32 %tmp6, %tmp945  %tmp11 = sext i32 %tmp5 to i6446  %tmp12 = getelementptr inbounds [1024 x i32], ptr @global, i64 0, i64 %tmp1147  %tmp13 = load i32, ptr %tmp12, align 448  %tmp14 = add nsw i32 %tmp10, %tmp1349  %tmp15 = add nsw i32 %tmp, %arg150  %tmp16 = add nsw i32 %tmp5, %arg151  br label %bb1752 53bb17:                                             ; preds = %bb354  %tmp18 = add i32 %tmp4, -155  %tmp19 = icmp ne i32 %tmp4, 056  br i1 %tmp19, label %bb3, label %bb2057 58bb20:                                             ; preds = %bb1759  ret i32 %tmp1460}61 62!llvm.module.flags = !{!0}63!llvm.ident = !{!1}64 65!0 = !{i32 1, !"PIC Level", i32 2}66!1 = !{!"Apple LLVM version 8.0.0 (clang-800.0.42.1)"}67