1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt -passes=indvars -S %s | FileCheck %s
4 @g_2168 = external global [4 x [6 x i32]], align 16
5 @g_1150 = external global ptr, align 8
7 define internal fastcc void @func_2() unnamed_addr {
8 ; CHECK-LABEL: @func_2(
9 ; CHECK-NEXT: lbl_2898.preheader:
10 ; CHECK-NEXT: br label [[LBL_2898:%.*]]
11 ; CHECK: lbl_2898.loopexit:
12 ; CHECK-NEXT: store ptr getelementptr inbounds ([4 x [6 x i32]], ptr @g_2168, i64 0, i64 3, i64 1), ptr @g_1150, align 8
13 ; CHECK-NEXT: br label [[LBL_2898]]
15 ; CHECK-NEXT: br label [[FOR_COND884:%.*]]
17 ; CHECK-NEXT: br i1 false, label [[FOR_BODY888:%.*]], label [[LBL_2898_LOOPEXIT:%.*]]
19 ; CHECK-NEXT: br label [[FOR_COND918:%.*]]
21 ; CHECK-NEXT: br label [[FOR_END926:%.*]]
23 ; CHECK-NEXT: br label [[FOR_COND936:%.*]]
25 ; CHECK-NEXT: br label [[FOR_END987:%.*]]
27 ; CHECK-NEXT: br label [[FOR_COND884]]
33 %.lcssa = phi ptr [ %0, %for.cond884 ]
34 store ptr %.lcssa, ptr @g_1150, align 8
38 %g_1150.promoted = load ptr, ptr @g_1150, align 8
42 %0 = phi ptr [ getelementptr inbounds ([4 x [6 x i32]], ptr @g_2168, i64 0, i64 3, i64 1), %for.end987 ], [ %g_1150.promoted, %lbl_2898 ]
43 %storemerge9 = phi i16 [ %add990, %for.end987 ], [ 0, %lbl_2898 ]
44 %cmp886 = icmp slt i16 %storemerge9, 3
45 br i1 %cmp886, label %for.body888, label %lbl_2898.loopexit
60 %add990 = add i16 %storemerge9, 1