1 ; RUN: opt < %s -loop-index-split -stats -disable-output |& grep "1 loop-index-split"
4 @w = external global [2 x [2 x i32]] ; <[2 x [2 x i32]]*> [#uses=5]
6 declare i32 @f() nounwind
8 define i32 @main() noreturn nounwind {
12 bb1.i.outer: ; preds = %bb5.i, %entry
13 %i.0.reg2mem.0.ph.i.ph = phi i32 [ 0, %entry ], [ %indvar.next1, %bb5.i ] ; <i32> [#uses=3]
16 bb1.i: ; preds = %bb3.i, %bb1.i.outer
17 %j.0.reg2mem.0.i = phi i32 [ 0, %bb1.i.outer ], [ %indvar.next, %bb3.i ] ; <i32> [#uses=3]
18 %0 = icmp eq i32 %i.0.reg2mem.0.ph.i.ph, %j.0.reg2mem.0.i ; <i1> [#uses=1]
19 br i1 %0, label %bb2.i, label %bb3.i
21 bb2.i: ; preds = %bb1.i
22 %1 = getelementptr [2 x [2 x i32]]* @w, i32 0, i32 %i.0.reg2mem.0.ph.i.ph, i32 %j.0.reg2mem.0.i ; <i32*> [#uses=1]
23 store i32 1, i32* %1, align 4
26 bb3.i: ; preds = %bb2.i, %bb1.i
27 %indvar.next = add i32 %j.0.reg2mem.0.i, 1 ; <i32> [#uses=2]
28 %exitcond = icmp eq i32 %indvar.next, 2 ; <i1> [#uses=1]
29 br i1 %exitcond, label %bb5.i, label %bb1.i
31 bb5.i: ; preds = %bb3.i
32 %indvar.next1 = add i32 %i.0.reg2mem.0.ph.i.ph, 1 ; <i32> [#uses=2]
33 %exitcond2 = icmp eq i32 %indvar.next1, 2 ; <i1> [#uses=1]
34 br i1 %exitcond2, label %f.exit, label %bb1.i.outer
36 f.exit: ; preds = %bb5.i
37 %2 = load i32* getelementptr ([2 x [2 x i32]]* @w, i32 0, i32 0, i32 0), align 4 ; <i32> [#uses=1]
38 %3 = icmp eq i32 %2, 1 ; <i1> [#uses=1]
39 br i1 %3, label %bb, label %bb3
42 %4 = load i32* getelementptr ([2 x [2 x i32]]* @w, i32 0, i32 1, i32 1), align 4 ; <i32> [#uses=1]
43 %5 = icmp eq i32 %4, 1 ; <i1> [#uses=1]
44 br i1 %5, label %bb1, label %bb3
47 %6 = load i32* getelementptr ([2 x [2 x i32]]* @w, i32 0, i32 1, i32 0), align 4 ; <i32> [#uses=1]
48 %7 = icmp eq i32 %6, 0 ; <i1> [#uses=1]
49 br i1 %7, label %bb2, label %bb3
52 %8 = load i32* getelementptr ([2 x [2 x i32]]* @w, i32 0, i32 0, i32 1), align 4 ; <i32> [#uses=1]
53 %9 = icmp eq i32 %8, 0 ; <i1> [#uses=1]
54 br i1 %9, label %bb4, label %bb3
56 bb3: ; preds = %bb2, %bb1, %bb, %f.exit
57 tail call void @abort() noreturn nounwind
64 declare void @abort() noreturn nounwind
66 declare void @exit(i32) noreturn nounwind