blob: d5a4d6ade7be0e5dd6b94233e5fc245b8f23969e [file] [log] [blame]
Dan Gohmanfce288f2009-09-09 00:09:15 +00001; RUN: llc < %s -regalloc=local
Jakob Stoklund Olesen85f4fda2010-05-12 00:11:24 +00002; RUN: llc < %s -regalloc=fast
Tanya Lattner53a66d12008-02-19 01:41:04 +00003
4%struct.CHESS_POSITION = type { i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i32, i32, i8, i8, [64 x i8], i8, i8, i8, i8, i8 }
5@search = external global %struct.CHESS_POSITION ; <%struct.CHESS_POSITION*> [#uses=2]
6@bishop_shift_rl45 = external global [64 x i32] ; <[64 x i32]*> [#uses=1]
7@bishop_shift_rr45 = external global [64 x i32] ; <[64 x i32]*> [#uses=1]
8@black_outpost = external global [64 x i8] ; <[64 x i8]*> [#uses=1]
9@bishop_mobility_rl45 = external global [64 x [256 x i32]] ; <[64 x [256 x i32]]*> [#uses=1]
10@bishop_mobility_rr45 = external global [64 x [256 x i32]] ; <[64 x [256 x i32]]*> [#uses=1]
Chris Lattner6cfca762006-09-03 07:14:47 +000011
Tanya Lattner53a66d12008-02-19 01:41:04 +000012declare fastcc i32 @FirstOne()
Chris Lattner6cfca762006-09-03 07:14:47 +000013
Tanya Lattner53a66d12008-02-19 01:41:04 +000014define fastcc void @Evaluate() {
Chris Lattner6cfca762006-09-03 07:14:47 +000015entry:
Tanya Lattner53a66d12008-02-19 01:41:04 +000016 br i1 false, label %cond_false186, label %cond_true
Chris Lattner6cfca762006-09-03 07:14:47 +000017
18cond_true: ; preds = %entry
19 ret void
20
21cond_false186: ; preds = %entry
Tanya Lattner53a66d12008-02-19 01:41:04 +000022 br i1 false, label %cond_true293, label %bb203
Chris Lattner6cfca762006-09-03 07:14:47 +000023
24bb203: ; preds = %cond_false186
25 ret void
26
27cond_true293: ; preds = %cond_false186
Tanya Lattner53a66d12008-02-19 01:41:04 +000028 br i1 false, label %cond_true298, label %cond_next317
Chris Lattner6cfca762006-09-03 07:14:47 +000029
30cond_true298: ; preds = %cond_true293
Tanya Lattner53a66d12008-02-19 01:41:04 +000031 br i1 false, label %cond_next518, label %cond_true397.preheader
Chris Lattner6cfca762006-09-03 07:14:47 +000032
33cond_next317: ; preds = %cond_true293
34 ret void
35
36cond_true397.preheader: ; preds = %cond_true298
37 ret void
38
39cond_next518: ; preds = %cond_true298
Tanya Lattner53a66d12008-02-19 01:41:04 +000040 br i1 false, label %bb1069, label %cond_true522
Chris Lattner6cfca762006-09-03 07:14:47 +000041
42cond_true522: ; preds = %cond_next518
43 ret void
44
45bb1069: ; preds = %cond_next518
Tanya Lattner53a66d12008-02-19 01:41:04 +000046 br i1 false, label %cond_next1131, label %bb1096
Chris Lattner6cfca762006-09-03 07:14:47 +000047
48bb1096: ; preds = %bb1069
49 ret void
50
51cond_next1131: ; preds = %bb1069
Tanya Lattner53a66d12008-02-19 01:41:04 +000052 br i1 false, label %cond_next1207, label %cond_true1150
Chris Lattner6cfca762006-09-03 07:14:47 +000053
54cond_true1150: ; preds = %cond_next1131
55 ret void
56
57cond_next1207: ; preds = %cond_next1131
Tanya Lattner53a66d12008-02-19 01:41:04 +000058 br i1 false, label %cond_next1219, label %cond_true1211
Chris Lattner6cfca762006-09-03 07:14:47 +000059
60cond_true1211: ; preds = %cond_next1207
61 ret void
62
63cond_next1219: ; preds = %cond_next1207
Tanya Lattner53a66d12008-02-19 01:41:04 +000064 br i1 false, label %cond_true1223, label %cond_next1283
Chris Lattner6cfca762006-09-03 07:14:47 +000065
66cond_true1223: ; preds = %cond_next1219
Tanya Lattner53a66d12008-02-19 01:41:04 +000067 br i1 false, label %cond_true1254, label %cond_true1264
Chris Lattner6cfca762006-09-03 07:14:47 +000068
69cond_true1254: ; preds = %cond_true1223
Tanya Lattner53a66d12008-02-19 01:41:04 +000070 br i1 false, label %bb1567, label %cond_true1369.preheader
Chris Lattner6cfca762006-09-03 07:14:47 +000071
72cond_true1264: ; preds = %cond_true1223
73 ret void
74
75cond_next1283: ; preds = %cond_next1219
76 ret void
77
78cond_true1369.preheader: ; preds = %cond_true1254
79 ret void
80
81bb1567: ; preds = %cond_true1254
Tanya Lattner53a66d12008-02-19 01:41:04 +000082 %tmp1580 = load i64* getelementptr (%struct.CHESS_POSITION* @search, i32 0, i32 3) ; <i64> [#uses=1]
83 %tmp1591 = load i64* getelementptr (%struct.CHESS_POSITION* @search, i32 0, i32 4) ; <i64> [#uses=1]
84 %tmp1572 = tail call fastcc i32 @FirstOne( ) ; <i32> [#uses=5]
85 %tmp1582 = getelementptr [64 x i32]* @bishop_shift_rl45, i32 0, i32 %tmp1572 ; <i32*> [#uses=1]
86 %tmp1583 = load i32* %tmp1582 ; <i32> [#uses=1]
87 %tmp1583.upgrd.1 = trunc i32 %tmp1583 to i8 ; <i8> [#uses=1]
88 %shift.upgrd.2 = zext i8 %tmp1583.upgrd.1 to i64 ; <i64> [#uses=1]
89 %tmp1584 = lshr i64 %tmp1580, %shift.upgrd.2 ; <i64> [#uses=1]
90 %tmp1584.upgrd.3 = trunc i64 %tmp1584 to i32 ; <i32> [#uses=1]
91 %tmp1585 = and i32 %tmp1584.upgrd.3, 255 ; <i32> [#uses=1]
92 %gep.upgrd.4 = zext i32 %tmp1585 to i64 ; <i64> [#uses=1]
93 %tmp1587 = getelementptr [64 x [256 x i32]]* @bishop_mobility_rl45, i32 0, i32 %tmp1572, i64 %gep.upgrd.4 ; <i32*> [#uses=1]
94 %tmp1588 = load i32* %tmp1587 ; <i32> [#uses=1]
95 %tmp1593 = getelementptr [64 x i32]* @bishop_shift_rr45, i32 0, i32 %tmp1572 ; <i32*> [#uses=1]
96 %tmp1594 = load i32* %tmp1593 ; <i32> [#uses=1]
97 %tmp1594.upgrd.5 = trunc i32 %tmp1594 to i8 ; <i8> [#uses=1]
98 %shift.upgrd.6 = zext i8 %tmp1594.upgrd.5 to i64 ; <i64> [#uses=1]
99 %tmp1595 = lshr i64 %tmp1591, %shift.upgrd.6 ; <i64> [#uses=1]
100 %tmp1595.upgrd.7 = trunc i64 %tmp1595 to i32 ; <i32> [#uses=1]
101 %tmp1596 = and i32 %tmp1595.upgrd.7, 255 ; <i32> [#uses=1]
102 %gep.upgrd.8 = zext i32 %tmp1596 to i64 ; <i64> [#uses=1]
103 %tmp1598 = getelementptr [64 x [256 x i32]]* @bishop_mobility_rr45, i32 0, i32 %tmp1572, i64 %gep.upgrd.8 ; <i32*> [#uses=1]
104 %tmp1599 = load i32* %tmp1598 ; <i32> [#uses=1]
105 %tmp1600.neg = sub i32 0, %tmp1588 ; <i32> [#uses=1]
106 %tmp1602 = sub i32 %tmp1600.neg, %tmp1599 ; <i32> [#uses=1]
107 %tmp1604 = getelementptr [64 x i8]* @black_outpost, i32 0, i32 %tmp1572 ; <i8*> [#uses=1]
108 %tmp1605 = load i8* %tmp1604 ; <i8> [#uses=1]
109 %tmp1606 = icmp eq i8 %tmp1605, 0 ; <i1> [#uses=1]
110 br i1 %tmp1606, label %cond_next1637, label %cond_true1607
Chris Lattner6cfca762006-09-03 07:14:47 +0000111
112cond_true1607: ; preds = %bb1567
113 ret void
114
115cond_next1637: ; preds = %bb1567
Tanya Lattner53a66d12008-02-19 01:41:04 +0000116 %tmp1662 = sub i32 %tmp1602, 0 ; <i32> [#uses=0]
Chris Lattner6cfca762006-09-03 07:14:47 +0000117 ret void
118}