1 ; RUN: llvm-upgrade < %s | llvm-as | llc -march=ppc32 | \
2 ; RUN: grep {b LBB.*} | wc -l | grep 4
5 target pointersize = 32
6 target triple = "powerpc-apple-darwin8.7.0"
8 implementation ; Functions:
10 void %foo(int %W, int %X, int %Y, int %Z) {
12 %X = cast int %X to uint ; <uint> [#uses=1]
13 %Y = cast int %Y to uint ; <uint> [#uses=1]
14 %Z = cast int %Z to uint ; <uint> [#uses=1]
15 %W = cast int %W to uint ; <uint> [#uses=1]
16 %tmp1 = and int %W, 1 ; <int> [#uses=1]
17 %tmp1 = seteq int %tmp1, 0 ; <bool> [#uses=1]
18 br bool %tmp1, label %cond_false, label %bb5
20 bb: ; preds = %bb5, %bb
21 %indvar77 = phi uint [ %indvar.next78, %bb ], [ 0, %bb5 ] ; <uint> [#uses=1]
22 %tmp2 = tail call int (...)* %bar( ) ; <int> [#uses=0]
23 %indvar.next78 = add uint %indvar77, 1 ; <uint> [#uses=2]
24 %exitcond79 = seteq uint %indvar.next78, %X ; <bool> [#uses=1]
25 br bool %exitcond79, label %cond_next48, label %bb
28 %tmp = seteq int %X, 0 ; <bool> [#uses=1]
29 br bool %tmp, label %cond_next48, label %bb
31 cond_false: ; preds = %entry
32 %tmp10 = and int %W, 2 ; <int> [#uses=1]
33 %tmp10 = seteq int %tmp10, 0 ; <bool> [#uses=1]
34 br bool %tmp10, label %cond_false20, label %bb16
36 bb12: ; preds = %bb16, %bb12
37 %indvar72 = phi uint [ %indvar.next73, %bb12 ], [ 0, %bb16 ] ; <uint> [#uses=1]
38 %tmp13 = tail call int (...)* %bar( ) ; <int> [#uses=0]
39 %indvar.next73 = add uint %indvar72, 1 ; <uint> [#uses=2]
40 %exitcond74 = seteq uint %indvar.next73, %Y ; <bool> [#uses=1]
41 br bool %exitcond74, label %cond_next48, label %bb12
43 bb16: ; preds = %cond_false
44 %tmp18 = seteq int %Y, 0 ; <bool> [#uses=1]
45 br bool %tmp18, label %cond_next48, label %bb12
47 cond_false20: ; preds = %cond_false
48 %tmp23 = and int %W, 4 ; <int> [#uses=1]
49 %tmp23 = seteq int %tmp23, 0 ; <bool> [#uses=1]
50 br bool %tmp23, label %cond_false33, label %bb29
52 bb25: ; preds = %bb29, %bb25
53 %indvar67 = phi uint [ %indvar.next68, %bb25 ], [ 0, %bb29 ] ; <uint> [#uses=1]
54 %tmp26 = tail call int (...)* %bar( ) ; <int> [#uses=0]
55 %indvar.next68 = add uint %indvar67, 1 ; <uint> [#uses=2]
56 %exitcond69 = seteq uint %indvar.next68, %Z ; <bool> [#uses=1]
57 br bool %exitcond69, label %cond_next48, label %bb25
59 bb29: ; preds = %cond_false20
60 %tmp31 = seteq int %Z, 0 ; <bool> [#uses=1]
61 br bool %tmp31, label %cond_next48, label %bb25
63 cond_false33: ; preds = %cond_false20
64 %tmp36 = and int %W, 8 ; <int> [#uses=1]
65 %tmp36 = seteq int %tmp36, 0 ; <bool> [#uses=1]
66 br bool %tmp36, label %cond_next48, label %bb42
69 %tmp39 = tail call int (...)* %bar( ) ; <int> [#uses=0]
70 %indvar.next = add uint %indvar, 1 ; <uint> [#uses=1]
73 bb42: ; preds = %cond_false33, %bb38
74 %indvar = phi uint [ %indvar.next, %bb38 ], [ 0, %cond_false33 ] ; <uint> [#uses=3]
75 %indvar = cast uint %indvar to int ; <int> [#uses=1]
76 %W_addr.0 = sub int %W, %indvar ; <int> [#uses=1]
77 %exitcond = seteq uint %indvar, %W ; <bool> [#uses=1]
78 br bool %exitcond, label %cond_next48, label %bb38
80 cond_next48: ; preds = %bb, %bb12, %bb25, %bb42, %cond_false33, %bb29, %bb16, %bb5
81 %W_addr.1 = phi int [ %W, %bb5 ], [ %W, %bb16 ], [ %W, %bb29 ], [ %W, %cond_false33 ], [ %W_addr.0, %bb42 ], [ %W, %bb25 ], [ %W, %bb12 ], [ %W, %bb ] ; <int> [#uses=1]
82 %tmp50 = seteq int %W_addr.1, 0 ; <bool> [#uses=1]
83 br bool %tmp50, label %UnifiedReturnBlock, label %cond_true51
85 cond_true51: ; preds = %cond_next48
86 %tmp52 = tail call int (...)* %bar( ) ; <int> [#uses=0]
89 UnifiedReturnBlock: ; preds = %cond_next48