1 ; RUN: llc < %s -march=x86 -stats |& grep {Number of loads added} | grep 2
2 ; RUN: llc < %s -march=x86 -stats |& grep {Number of register spills} | grep 1
3 ; RUN: llc < %s -march=x86 -stats |& grep {Number of machine instrs printed} | grep 34
6 target triple = "i386-pc-linux-gnu"
7 @x = external global [8 x i32], align 32 ; <[8 x i32]*> [#uses=1]
8 @rows = external global [8 x i32], align 32 ; <[8 x i32]*> [#uses=2]
9 @up = external global [15 x i32], align 32 ; <[15 x i32]*> [#uses=2]
10 @down = external global [15 x i32], align 32 ; <[15 x i32]*> [#uses=1]
12 define i32 @queens(i32 %c) nounwind {
14 %tmp91 = add i32 %c, 1 ; <i32> [#uses=3]
15 %tmp135 = getelementptr [8 x i32]* @x, i32 0, i32 %tmp91 ; <i32*> [#uses=1]
18 bb: ; preds = %bb569, %entry
19 %r25.0.reg2mem.0 = phi i32 [ 0, %entry ], [ %indvar.next715, %bb569 ] ; <i32> [#uses=4]
20 %tmp27 = getelementptr [8 x i32]* @rows, i32 0, i32 %r25.0.reg2mem.0 ; <i32*> [#uses=1]
21 %tmp28 = load i32* %tmp27, align 4 ; <i32> [#uses=1]
22 %tmp29 = icmp eq i32 %tmp28, 0 ; <i1> [#uses=1]
23 br i1 %tmp29, label %bb569, label %bb31
26 %tmp35 = sub i32 %r25.0.reg2mem.0, 0 ; <i32> [#uses=1]
27 %tmp36 = getelementptr [15 x i32]* @up, i32 0, i32 %tmp35 ; <i32*> [#uses=1]
28 %tmp37 = load i32* %tmp36, align 4 ; <i32> [#uses=1]
29 %tmp38 = icmp eq i32 %tmp37, 0 ; <i1> [#uses=1]
30 br i1 %tmp38, label %bb569, label %bb41
33 %tmp54 = sub i32 %r25.0.reg2mem.0, %c ; <i32> [#uses=1]
34 %tmp55 = add i32 %tmp54, 7 ; <i32> [#uses=1]
35 %tmp62 = getelementptr [15 x i32]* @up, i32 0, i32 %tmp55 ; <i32*> [#uses=2]
36 store i32 0, i32* %tmp62, align 4
39 bb92: ; preds = %bb545, %bb41
40 %r20.0.reg2mem.0 = phi i32 [ 0, %bb41 ], [ %indvar.next711, %bb545 ] ; <i32> [#uses=5]
41 %tmp94 = getelementptr [8 x i32]* @rows, i32 0, i32 %r20.0.reg2mem.0 ; <i32*> [#uses=1]
42 %tmp95 = load i32* %tmp94, align 4 ; <i32> [#uses=0]
43 %tmp112 = add i32 %r20.0.reg2mem.0, %tmp91 ; <i32> [#uses=1]
44 %tmp113 = getelementptr [15 x i32]* @down, i32 0, i32 %tmp112 ; <i32*> [#uses=2]
45 %tmp114 = load i32* %tmp113, align 4 ; <i32> [#uses=1]
46 %tmp115 = icmp eq i32 %tmp114, 0 ; <i1> [#uses=1]
47 br i1 %tmp115, label %bb545, label %bb118
49 bb118: ; preds = %bb92
50 %tmp122 = sub i32 %r20.0.reg2mem.0, %tmp91 ; <i32> [#uses=0]
51 store i32 0, i32* %tmp113, align 4
52 store i32 %r20.0.reg2mem.0, i32* %tmp135, align 4
55 bb142: ; preds = %bb142, %bb118
56 %k18.0.reg2mem.0 = phi i32 [ 0, %bb118 ], [ %indvar.next709, %bb142 ] ; <i32> [#uses=1]
57 %indvar.next709 = add i32 %k18.0.reg2mem.0, 1 ; <i32> [#uses=2]
58 %exitcond710 = icmp eq i32 %indvar.next709, 8 ; <i1> [#uses=1]
59 br i1 %exitcond710, label %bb155, label %bb142
61 bb155: ; preds = %bb142
62 %tmp156 = tail call i32 @putchar(i32 10) nounwind ; <i32> [#uses=0]
65 bb545: ; preds = %bb155, %bb92
66 %indvar.next711 = add i32 %r20.0.reg2mem.0, 1 ; <i32> [#uses=2]
67 %exitcond712 = icmp eq i32 %indvar.next711, 8 ; <i1> [#uses=1]
68 br i1 %exitcond712, label %bb553, label %bb92
70 bb553: ; preds = %bb545
71 store i32 1, i32* %tmp62, align 4
74 bb569: ; preds = %bb553, %bb31, %bb
75 %indvar.next715 = add i32 %r25.0.reg2mem.0, 1 ; <i32> [#uses=1]
79 declare i32 @putchar(i32)