1 ; RUN: llvm-as < %s | llc -march=x86 -stats |& \
2 ; RUN: grep {1 .*folded into instructions}
3 ; RUN: llvm-as < %s | llc -march=x86 | grep cmp | count 4
5 %struct.quad_struct = type { i32, i32, %struct.quad_struct*, %struct.quad_struct*, %struct.quad_struct*, %struct.quad_struct*, %struct.quad_struct* }
7 define fastcc i32 @perimeter(%struct.quad_struct* %tree, i32 %size) {
9 %tree.idx7.val = load %struct.quad_struct** null ; <%struct.quad_struct*> [#uses=1]
10 %tmp8.i51 = icmp eq %struct.quad_struct* %tree.idx7.val, null ; <i1> [#uses=2]
11 br i1 %tmp8.i51, label %cond_next, label %cond_next.i52
13 cond_next.i52: ; preds = %entry
16 cond_next: ; preds = %entry
17 %tmp59 = load i32* null, align 4 ; <i32> [#uses=1]
18 %tmp70 = icmp eq i32 %tmp59, 2 ; <i1> [#uses=1]
19 br i1 %tmp70, label %cond_true.i35, label %bb80
21 cond_true.i35: ; preds = %cond_next
22 %tmp14.i.i37 = load %struct.quad_struct** null, align 4 ; <%struct.quad_struct*> [#uses=1]
23 %tmp3.i160 = load i32* null, align 4 ; <i32> [#uses=1]
24 %tmp4.i161 = icmp eq i32 %tmp3.i160, 2 ; <i1> [#uses=1]
25 br i1 %tmp4.i161, label %cond_true.i163, label %cond_false.i178
27 cond_true.i163: ; preds = %cond_true.i35
28 %tmp7.i162 = sdiv i32 %size, 4 ; <i32> [#uses=2]
29 %tmp13.i168 = tail call fastcc i32 @sum_adjacent( %struct.quad_struct* null, i32 3, i32 2, i32 %tmp7.i162 ) ; <i32> [#uses=1]
30 %tmp18.i11.i170 = getelementptr %struct.quad_struct* %tmp14.i.i37, i32 0, i32 4 ; <%struct.quad_struct**> [#uses=1]
31 %tmp19.i12.i171 = load %struct.quad_struct** %tmp18.i11.i170, align 4 ; <%struct.quad_struct*> [#uses=1]
32 %tmp21.i173 = tail call fastcc i32 @sum_adjacent( %struct.quad_struct* %tmp19.i12.i171, i32 3, i32 2, i32 %tmp7.i162 ) ; <i32> [#uses=1]
33 %tmp22.i174 = add i32 %tmp21.i173, %tmp13.i168 ; <i32> [#uses=1]
34 br i1 %tmp4.i161, label %cond_true.i141, label %cond_false.i156
36 cond_false.i178: ; preds = %cond_true.i35
39 cond_true.i141: ; preds = %cond_true.i163
40 %tmp7.i140 = sdiv i32 %size, 4 ; <i32> [#uses=1]
41 %tmp21.i151 = tail call fastcc i32 @sum_adjacent( %struct.quad_struct* null, i32 3, i32 2, i32 %tmp7.i140 ) ; <i32> [#uses=0]
44 cond_false.i156: ; preds = %cond_true.i163
45 %tmp22.i44 = add i32 0, %tmp22.i174 ; <i32> [#uses=0]
46 br i1 %tmp8.i51, label %bb22.i, label %cond_next.i
48 bb80: ; preds = %cond_next
51 cond_next.i: ; preds = %cond_false.i156
54 bb22.i: ; preds = %cond_false.i156
58 declare fastcc i32 @sum_adjacent(%struct.quad_struct*, i32, i32, i32)