33
44define i1 @remove_shift_nuw_ab (i8 %a , i8 %b , i8 %s ) {
55; CHECK-LABEL: @remove_shift_nuw_ab(
6- ; CHECK-NEXT: [[T:%.*]] = shl nuw i8 [[A:%.*]], [[S:%.*]]
7- ; CHECK-NEXT: [[OR:%.*]] = or i8 [[T]], [[B:%.*]]
6+ ; CHECK-NEXT: [[OR:%.*]] = or i8 [[T:%.*]], [[B:%.*]]
87; CHECK-NEXT: [[IC:%.*]] = icmp eq i8 [[OR]], 0
98; CHECK-NEXT: ret i1 [[IC]]
109;
@@ -16,8 +15,7 @@ define i1 @remove_shift_nuw_ab(i8 %a, i8 %b, i8 %s) {
1615
1716define i1 @remove_shift_nuw_ba (i8 %a , i8 %b , i8 %s ) {
1817; CHECK-LABEL: @remove_shift_nuw_ba(
19- ; CHECK-NEXT: [[T:%.*]] = shl nuw i8 [[A:%.*]], [[S:%.*]]
20- ; CHECK-NEXT: [[OR:%.*]] = or i8 [[B:%.*]], [[T]]
18+ ; CHECK-NEXT: [[OR:%.*]] = or i8 [[B:%.*]], [[T:%.*]]
2119; CHECK-NEXT: [[IC:%.*]] = icmp eq i8 [[OR]], 0
2220; CHECK-NEXT: ret i1 [[IC]]
2321;
@@ -29,8 +27,7 @@ define i1 @remove_shift_nuw_ba(i8 %a, i8 %b, i8 %s) {
2927
3028define i1 @remove_shift_nsw (i8 %a , i8 %b , i8 %s ) {
3129; CHECK-LABEL: @remove_shift_nsw(
32- ; CHECK-NEXT: [[T:%.*]] = shl nsw i8 [[A:%.*]], [[S:%.*]]
33- ; CHECK-NEXT: [[OR:%.*]] = or i8 [[T]], [[B:%.*]]
30+ ; CHECK-NEXT: [[OR:%.*]] = or i8 [[T:%.*]], [[B:%.*]]
3431; CHECK-NEXT: [[IC:%.*]] = icmp eq i8 [[OR]], 0
3532; CHECK-NEXT: ret i1 [[IC]]
3633;
@@ -42,8 +39,7 @@ define i1 @remove_shift_nsw(i8 %a, i8 %b, i8 %s) {
4239
4340define i1 @remove_shift_nuw_ne (i8 %a , i8 %b , i8 %s ) {
4441; CHECK-LABEL: @remove_shift_nuw_ne(
45- ; CHECK-NEXT: [[T:%.*]] = shl nuw i8 [[A:%.*]], [[S:%.*]]
46- ; CHECK-NEXT: [[OR:%.*]] = or i8 [[T]], [[B:%.*]]
42+ ; CHECK-NEXT: [[OR:%.*]] = or i8 [[T:%.*]], [[B:%.*]]
4743; CHECK-NEXT: [[IC:%.*]] = icmp eq i8 [[OR]], 0
4844; CHECK-NEXT: ret i1 [[IC]]
4945;
@@ -55,8 +51,7 @@ define i1 @remove_shift_nuw_ne(i8 %a, i8 %b, i8 %s) {
5551
5652define i1 @remove_shift_nsw_ne (i8 %a , i8 %b , i8 %s ) {
5753; CHECK-LABEL: @remove_shift_nsw_ne(
58- ; CHECK-NEXT: [[T:%.*]] = shl nsw i8 [[A:%.*]], [[S:%.*]]
59- ; CHECK-NEXT: [[OR:%.*]] = or i8 [[T]], [[B:%.*]]
54+ ; CHECK-NEXT: [[OR:%.*]] = or i8 [[T:%.*]], [[B:%.*]]
6055; CHECK-NEXT: [[IC:%.*]] = icmp eq i8 [[OR]], 0
6156; CHECK-NEXT: ret i1 [[IC]]
6257;
@@ -81,9 +76,8 @@ define i1 @remove_shift_wraps(i8 %a, i8 %b, i8 %s) {
8176
8277define i1 @remove_shift_chain_d (i8 %a , i8 %b , i8 %c , i8 %d , i8 %s ) {
8378; CHECK-LABEL: @remove_shift_chain_d(
84- ; CHECK-NEXT: [[DT:%.*]] = shl nuw i8 [[D:%.*]], [[S:%.*]]
8579; CHECK-NEXT: [[OR1:%.*]] = or i8 [[A:%.*]], [[B:%.*]]
86- ; CHECK-NEXT: [[OR2:%.*]] = or i8 [[C:%.*]], [[DT]]
80+ ; CHECK-NEXT: [[OR2:%.*]] = or i8 [[C:%.*]], [[DT:%.* ]]
8781; CHECK-NEXT: [[OR:%.*]] = or i8 [[OR1]], [[OR2]]
8882; CHECK-NEXT: [[IC:%.*]] = icmp eq i8 [[OR]], 0
8983; CHECK-NEXT: ret i1 [[IC]]
@@ -98,12 +92,8 @@ define i1 @remove_shift_chain_d(i8 %a, i8 %b, i8 %c, i8 %d, i8 %s) {
9892
9993define i1 @remove_shift_chain_abcd (i8 %a , i8 %b , i8 %c , i8 %d , i8 %s ) {
10094; CHECK-LABEL: @remove_shift_chain_abcd(
101- ; CHECK-NEXT: [[AT:%.*]] = shl nuw i8 [[A:%.*]], [[S:%.*]]
102- ; CHECK-NEXT: [[BT:%.*]] = shl nuw i8 [[B:%.*]], 2
103- ; CHECK-NEXT: [[CT:%.*]] = shl nuw i8 [[C:%.*]], 1
104- ; CHECK-NEXT: [[DT:%.*]] = shl nuw i8 [[D:%.*]], [[S]]
105- ; CHECK-NEXT: [[OR1:%.*]] = or i8 [[AT]], [[BT]]
106- ; CHECK-NEXT: [[OR2:%.*]] = or i8 [[CT]], [[DT]]
95+ ; CHECK-NEXT: [[OR1:%.*]] = or i8 [[AT:%.*]], [[BT:%.*]]
96+ ; CHECK-NEXT: [[OR2:%.*]] = or i8 [[CT:%.*]], [[DT:%.*]]
10797; CHECK-NEXT: [[OR:%.*]] = or i8 [[OR1]], [[OR2]]
10898; CHECK-NEXT: [[IC:%.*]] = icmp eq i8 [[OR]], 0
10999; CHECK-NEXT: ret i1 [[IC]]
0 commit comments