118 lines · plain
1; RUN: llc < %s -regalloc=fast -optimize-regalloc=02 3%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 }4@search = external global %struct.CHESS_POSITION ; <ptr> [#uses=2]5@bishop_shift_rl45 = external global [64 x i32] ; <ptr> [#uses=1]6@bishop_shift_rr45 = external global [64 x i32] ; <ptr> [#uses=1]7@black_outpost = external global [64 x i8] ; <ptr> [#uses=1]8@bishop_mobility_rl45 = external global [64 x [256 x i32]] ; <ptr> [#uses=1]9@bishop_mobility_rr45 = external global [64 x [256 x i32]] ; <ptr> [#uses=1]10 11declare fastcc i32 @FirstOne()12 13define fastcc void @Evaluate() {14entry:15 br i1 false, label %cond_false186, label %cond_true16 17cond_true: ; preds = %entry18 ret void19 20cond_false186: ; preds = %entry21 br i1 false, label %cond_true293, label %bb20322 23bb203: ; preds = %cond_false18624 ret void25 26cond_true293: ; preds = %cond_false18627 br i1 false, label %cond_true298, label %cond_next31728 29cond_true298: ; preds = %cond_true29330 br i1 false, label %cond_next518, label %cond_true397.preheader31 32cond_next317: ; preds = %cond_true29333 ret void34 35cond_true397.preheader: ; preds = %cond_true29836 ret void37 38cond_next518: ; preds = %cond_true29839 br i1 false, label %bb1069, label %cond_true52240 41cond_true522: ; preds = %cond_next51842 ret void43 44bb1069: ; preds = %cond_next51845 br i1 false, label %cond_next1131, label %bb109646 47bb1096: ; preds = %bb106948 ret void49 50cond_next1131: ; preds = %bb106951 br i1 false, label %cond_next1207, label %cond_true115052 53cond_true1150: ; preds = %cond_next113154 ret void55 56cond_next1207: ; preds = %cond_next113157 br i1 false, label %cond_next1219, label %cond_true121158 59cond_true1211: ; preds = %cond_next120760 ret void61 62cond_next1219: ; preds = %cond_next120763 br i1 false, label %cond_true1223, label %cond_next128364 65cond_true1223: ; preds = %cond_next121966 br i1 false, label %cond_true1254, label %cond_true126467 68cond_true1254: ; preds = %cond_true122369 br i1 false, label %bb1567, label %cond_true1369.preheader70 71cond_true1264: ; preds = %cond_true122372 ret void73 74cond_next1283: ; preds = %cond_next121975 ret void76 77cond_true1369.preheader: ; preds = %cond_true125478 ret void79 80bb1567: ; preds = %cond_true125481 %tmp1580 = load i64, ptr getelementptr (%struct.CHESS_POSITION, ptr @search, i32 0, i32 3) ; <i64> [#uses=1]82 %tmp1591 = load i64, ptr getelementptr (%struct.CHESS_POSITION, ptr @search, i32 0, i32 4) ; <i64> [#uses=1]83 %tmp1572 = tail call fastcc i32 @FirstOne( ) ; <i32> [#uses=5]84 %tmp1582 = getelementptr [64 x i32], ptr @bishop_shift_rl45, i32 0, i32 %tmp1572 ; <ptr> [#uses=1]85 %tmp1583 = load i32, ptr %tmp1582 ; <i32> [#uses=1]86 %tmp1583.upgrd.1 = trunc i32 %tmp1583 to i8 ; <i8> [#uses=1]87 %shift.upgrd.2 = zext i8 %tmp1583.upgrd.1 to i64 ; <i64> [#uses=1]88 %tmp1584 = lshr i64 %tmp1580, %shift.upgrd.2 ; <i64> [#uses=1]89 %tmp1584.upgrd.3 = trunc i64 %tmp1584 to i32 ; <i32> [#uses=1]90 %tmp1585 = and i32 %tmp1584.upgrd.3, 255 ; <i32> [#uses=1]91 %gep.upgrd.4 = zext i32 %tmp1585 to i64 ; <i64> [#uses=1]92 %tmp1587 = getelementptr [64 x [256 x i32]], ptr @bishop_mobility_rl45, i32 0, i32 %tmp1572, i64 %gep.upgrd.4 ; <ptr> [#uses=1]93 %tmp1588 = load i32, ptr %tmp1587 ; <i32> [#uses=1]94 %tmp1593 = getelementptr [64 x i32], ptr @bishop_shift_rr45, i32 0, i32 %tmp1572 ; <ptr> [#uses=1]95 %tmp1594 = load i32, ptr %tmp1593 ; <i32> [#uses=1]96 %tmp1594.upgrd.5 = trunc i32 %tmp1594 to i8 ; <i8> [#uses=1]97 %shift.upgrd.6 = zext i8 %tmp1594.upgrd.5 to i64 ; <i64> [#uses=1]98 %tmp1595 = lshr i64 %tmp1591, %shift.upgrd.6 ; <i64> [#uses=1]99 %tmp1595.upgrd.7 = trunc i64 %tmp1595 to i32 ; <i32> [#uses=1]100 %tmp1596 = and i32 %tmp1595.upgrd.7, 255 ; <i32> [#uses=1]101 %gep.upgrd.8 = zext i32 %tmp1596 to i64 ; <i64> [#uses=1]102 %tmp1598 = getelementptr [64 x [256 x i32]], ptr @bishop_mobility_rr45, i32 0, i32 %tmp1572, i64 %gep.upgrd.8 ; <ptr> [#uses=1]103 %tmp1599 = load i32, ptr %tmp1598 ; <i32> [#uses=1]104 %tmp1600.neg = sub i32 0, %tmp1588 ; <i32> [#uses=1]105 %tmp1602 = sub i32 %tmp1600.neg, %tmp1599 ; <i32> [#uses=1]106 %tmp1604 = getelementptr [64 x i8], ptr @black_outpost, i32 0, i32 %tmp1572 ; <ptr> [#uses=1]107 %tmp1605 = load i8, ptr %tmp1604 ; <i8> [#uses=1]108 %tmp1606 = icmp eq i8 %tmp1605, 0 ; <i1> [#uses=1]109 br i1 %tmp1606, label %cond_next1637, label %cond_true1607110 111cond_true1607: ; preds = %bb1567112 ret void113 114cond_next1637: ; preds = %bb1567115 %tmp1662 = sub i32 %tmp1602, 0 ; <i32> [#uses=0]116 ret void117}118