99define i8 @src_and_bit (i8 %x , i8 %y ) {
1010; CHECK-LABEL: @src_and_bit(
1111; CHECK-NEXT: [[AND:%.*]] = and i8 [[X:%.*]], 3
12- ; CHECK-NEXT: [[AND1:%.*]] = and i8 [[X]], 2
1312; CHECK-NEXT: [[CMP:%.*]] = icmp eq i8 [[AND]], 2
14- ; CHECK-NEXT: [[COND:%.*]] = select i1 [[CMP]], i8 [[AND1]] , i8 1
13+ ; CHECK-NEXT: [[COND:%.*]] = select i1 [[CMP]], i8 2 , i8 1
1514; CHECK-NEXT: ret i8 [[COND]]
1615;
1716 %and = and i8 %x , 3
@@ -24,9 +23,8 @@ define i8 @src_and_bit(i8 %x, i8 %y) {
2423define <2 x i8 > @src_and_bit_vec (<2 x i8 > %x , <2 x i8 > %y ) {
2524; CHECK-LABEL: @src_and_bit_vec(
2625; CHECK-NEXT: [[AND:%.*]] = and <2 x i8> [[X:%.*]], <i8 3, i8 3>
27- ; CHECK-NEXT: [[AND1:%.*]] = and <2 x i8> [[X]], <i8 2, i8 2>
2826; CHECK-NEXT: [[CMP:%.*]] = icmp eq <2 x i8> [[AND]], <i8 2, i8 2>
29- ; CHECK-NEXT: [[COND:%.*]] = select <2 x i1> [[CMP]], <2 x i8> [[AND1]] , <2 x i8> <i8 1, i8 1>
27+ ; CHECK-NEXT: [[COND:%.*]] = select <2 x i1> [[CMP]], <2 x i8> <i8 2, i8 2> , <2 x i8> <i8 1, i8 1>
3028; CHECK-NEXT: ret <2 x i8> [[COND]]
3129;
3230 %and = and <2 x i8 > %x , <i8 3 , i8 3 >
@@ -39,9 +37,8 @@ define <2 x i8> @src_and_bit_vec(<2 x i8> %x, <2 x i8> %y) {
3937define <2 x i8 > @src_and_bit_vec_poison (<2 x i8 > %x , <2 x i8 > %y ) {
4038; CHECK-LABEL: @src_and_bit_vec_poison(
4139; CHECK-NEXT: [[AND:%.*]] = and <2 x i8> [[X:%.*]], <i8 poison, i8 3>
42- ; CHECK-NEXT: [[AND1:%.*]] = and <2 x i8> [[X]], <i8 poison, i8 2>
4340; CHECK-NEXT: [[CMP:%.*]] = icmp eq <2 x i8> [[AND]], <i8 2, i8 2>
44- ; CHECK-NEXT: [[COND:%.*]] = select <2 x i1> [[CMP]], <2 x i8> [[AND1]] , <2 x i8> <i8 1, i8 1>
41+ ; CHECK-NEXT: [[COND:%.*]] = select <2 x i1> [[CMP]], <2 x i8> <i8 2, i8 2> , <2 x i8> <i8 1, i8 1>
4542; CHECK-NEXT: ret <2 x i8> [[COND]]
4643;
4744 %and = and <2 x i8 > %x , <i8 poison, i8 3 >
@@ -54,9 +51,8 @@ define <2 x i8> @src_and_bit_vec_poison(<2 x i8> %x, <2 x i8> %y) {
5451define <2 x i8 > @src_and_bit_vec_poison2 (<2 x i8 > %x , <2 x i8 > %y ) {
5552; CHECK-LABEL: @src_and_bit_vec_poison2(
5653; CHECK-NEXT: [[AND:%.*]] = and <2 x i8> [[X:%.*]], <i8 poison, i8 3>
57- ; CHECK-NEXT: [[AND1:%.*]] = and <2 x i8> [[X]], <i8 poison, i8 2>
5854; CHECK-NEXT: [[CMP:%.*]] = icmp eq <2 x i8> [[AND]], <i8 2, i8 2>
59- ; CHECK-NEXT: [[COND:%.*]] = select <2 x i1> [[CMP]], <2 x i8> [[AND1]] , <2 x i8> <i8 1, i8 1>
55+ ; CHECK-NEXT: [[COND:%.*]] = select <2 x i1> [[CMP]], <2 x i8> <i8 2, i8 2> , <2 x i8> <i8 1, i8 1>
6056; CHECK-NEXT: ret <2 x i8> [[COND]]
6157;
6258 %and = and <2 x i8 > %x , <i8 poison, i8 3 >
@@ -70,13 +66,11 @@ define <2 x i8> @src_and_bit_vec_poison2(<2 x i8> %x, <2 x i8> %y) {
7066; ====================== OR =======================
7167define i8 @src_or_bit (i8 %x , i8 %y , i8 %z ) {
7268; CHECK-LABEL: @src_or_bit(
73- ; CHECK-NEXT: [[AND:%.*]] = and i8 [[Z:%.*]], 3
7469; CHECK-NEXT: [[AND1:%.*]] = shl i8 [[Y:%.*]], 2
7570; CHECK-NEXT: [[SHL:%.*]] = and i8 [[AND1]], 12
7671; CHECK-NEXT: [[OR:%.*]] = or i8 [[SHL]], [[X:%.*]]
7772; CHECK-NEXT: [[CMP:%.*]] = icmp eq i8 [[OR]], 3
78- ; CHECK-NEXT: [[OR2:%.*]] = or i8 [[AND]], [[X]]
79- ; CHECK-NEXT: [[COND:%.*]] = select i1 [[CMP]], i8 [[OR2]], i8 1
73+ ; CHECK-NEXT: [[COND:%.*]] = select i1 [[CMP]], i8 3, i8 1
8074; CHECK-NEXT: ret i8 [[COND]]
8175;
8276 %and = and i8 %z , 3
@@ -90,13 +84,11 @@ define i8 @src_or_bit(i8 %x, i8 %y, i8 %z) {
9084}
9185define <2 x i8 > @src_or_bit_vec (<2 x i8 > %x , <2 x i8 > %y , <2 x i8 > %z ) {
9286; CHECK-LABEL: @src_or_bit_vec(
93- ; CHECK-NEXT: [[AND:%.*]] = and <2 x i8> [[Z:%.*]], <i8 3, i8 3>
9487; CHECK-NEXT: [[AND1:%.*]] = shl <2 x i8> [[Y:%.*]], <i8 2, i8 2>
9588; CHECK-NEXT: [[SHL:%.*]] = and <2 x i8> [[AND1]], <i8 12, i8 12>
9689; CHECK-NEXT: [[OR:%.*]] = or <2 x i8> [[SHL]], [[X:%.*]]
9790; CHECK-NEXT: [[CMP:%.*]] = icmp eq <2 x i8> [[OR]], <i8 3, i8 3>
98- ; CHECK-NEXT: [[OR2:%.*]] = or <2 x i8> [[AND]], [[X]]
99- ; CHECK-NEXT: [[COND:%.*]] = select <2 x i1> [[CMP]], <2 x i8> [[OR2]], <2 x i8> <i8 1, i8 1>
91+ ; CHECK-NEXT: [[COND:%.*]] = select <2 x i1> [[CMP]], <2 x i8> <i8 3, i8 3>, <2 x i8> <i8 1, i8 1>
10092; CHECK-NEXT: ret <2 x i8> [[COND]]
10193;
10294 %and = and <2 x i8 > %z , <i8 3 , i8 3 >
@@ -110,13 +102,11 @@ define <2 x i8> @src_or_bit_vec(<2 x i8> %x, <2 x i8> %y, <2 x i8> %z) {
110102}
111103define <2 x i8 > @src_or_bit_vec_poison (<2 x i8 > %x , <2 x i8 > %y , <2 x i8 > %z ) {
112104; CHECK-LABEL: @src_or_bit_vec_poison(
113- ; CHECK-NEXT: [[AND:%.*]] = and <2 x i8> [[Z:%.*]], <i8 3, i8 poison>
114105; CHECK-NEXT: [[AND1:%.*]] = shl <2 x i8> [[Y:%.*]], <i8 2, i8 poison>
115106; CHECK-NEXT: [[SHL:%.*]] = and <2 x i8> [[AND1]], <i8 12, i8 poison>
116107; CHECK-NEXT: [[OR:%.*]] = or <2 x i8> [[SHL]], [[X:%.*]]
117108; CHECK-NEXT: [[CMP:%.*]] = icmp eq <2 x i8> [[OR]], <i8 3, i8 3>
118- ; CHECK-NEXT: [[OR2:%.*]] = or <2 x i8> [[AND]], [[X]]
119- ; CHECK-NEXT: [[COND:%.*]] = select <2 x i1> [[CMP]], <2 x i8> [[OR2]], <2 x i8> <i8 1, i8 1>
109+ ; CHECK-NEXT: [[COND:%.*]] = select <2 x i1> [[CMP]], <2 x i8> <i8 3, i8 3>, <2 x i8> <i8 1, i8 1>
120110; CHECK-NEXT: ret <2 x i8> [[COND]]
121111;
122112 %and = and <2 x i8 > %z , <i8 3 , i8 poison>
@@ -130,13 +120,11 @@ define <2 x i8> @src_or_bit_vec_poison(<2 x i8> %x, <2 x i8> %y, <2 x i8> %z) {
130120}
131121define <2 x i8 > @src_or_bit_vec_poison2 (<2 x i8 > %x , <2 x i8 > %y , <2 x i8 > %z ) {
132122; CHECK-LABEL: @src_or_bit_vec_poison2(
133- ; CHECK-NEXT: [[AND:%.*]] = and <2 x i8> [[Z:%.*]], <i8 poison, i8 3>
134123; CHECK-NEXT: [[AND1:%.*]] = shl <2 x i8> [[Y:%.*]], <i8 poison, i8 2>
135124; CHECK-NEXT: [[SHL:%.*]] = and <2 x i8> [[AND1]], <i8 poison, i8 12>
136125; CHECK-NEXT: [[OR:%.*]] = or <2 x i8> [[SHL]], [[X:%.*]]
137126; CHECK-NEXT: [[CMP:%.*]] = icmp eq <2 x i8> [[OR]], <i8 3, i8 3>
138- ; CHECK-NEXT: [[OR2:%.*]] = or <2 x i8> [[AND]], [[X]]
139- ; CHECK-NEXT: [[COND:%.*]] = select <2 x i1> [[CMP]], <2 x i8> [[OR2]], <2 x i8> <i8 1, i8 1>
127+ ; CHECK-NEXT: [[COND:%.*]] = select <2 x i1> [[CMP]], <2 x i8> <i8 3, i8 3>, <2 x i8> <i8 1, i8 1>
140128; CHECK-NEXT: ret <2 x i8> [[COND]]
141129;
142130 %and = and <2 x i8 > %z , <i8 poison, i8 3 >
@@ -154,8 +142,7 @@ define i8 @src_xor_bit(i8 %x, i8 %y) {
154142; CHECK-NEXT: [[AND:%.*]] = and i8 [[Y:%.*]], 12
155143; CHECK-NEXT: [[XOR:%.*]] = xor i8 [[AND]], [[X:%.*]]
156144; CHECK-NEXT: [[CMP:%.*]] = icmp eq i8 [[XOR]], 3
157- ; CHECK-NEXT: [[AND1:%.*]] = and i8 [[X]], 3
158- ; CHECK-NEXT: [[COND:%.*]] = select i1 [[CMP]], i8 [[AND1]], i8 1
145+ ; CHECK-NEXT: [[COND:%.*]] = select i1 [[CMP]], i8 3, i8 1
159146; CHECK-NEXT: ret i8 [[COND]]
160147;
161148 %and = and i8 %y , 12
@@ -170,8 +157,7 @@ define <2 x i8> @src_xor_bit_vec(<2 x i8> %x, <2 x i8> %y) {
170157; CHECK-NEXT: [[AND:%.*]] = and <2 x i8> [[Y:%.*]], <i8 12, i8 12>
171158; CHECK-NEXT: [[XOR:%.*]] = xor <2 x i8> [[AND]], [[X:%.*]]
172159; CHECK-NEXT: [[CMP:%.*]] = icmp eq <2 x i8> [[XOR]], <i8 3, i8 3>
173- ; CHECK-NEXT: [[AND1:%.*]] = and <2 x i8> [[X]], <i8 3, i8 3>
174- ; CHECK-NEXT: [[COND:%.*]] = select <2 x i1> [[CMP]], <2 x i8> [[AND1]], <2 x i8> <i8 1, i8 1>
160+ ; CHECK-NEXT: [[COND:%.*]] = select <2 x i1> [[CMP]], <2 x i8> <i8 3, i8 3>, <2 x i8> <i8 1, i8 1>
175161; CHECK-NEXT: ret <2 x i8> [[COND]]
176162;
177163 %and = and <2 x i8 > %y , <i8 12 , i8 12 >
@@ -186,8 +172,7 @@ define <2 x i8> @src_xor_bit_vec_poison(<2 x i8> %x, <2 x i8> %y) {
186172; CHECK-NEXT: [[AND:%.*]] = and <2 x i8> [[Y:%.*]], <i8 poison, i8 12>
187173; CHECK-NEXT: [[XOR:%.*]] = xor <2 x i8> [[AND]], [[X:%.*]]
188174; CHECK-NEXT: [[CMP:%.*]] = icmp eq <2 x i8> [[XOR]], <i8 3, i8 3>
189- ; CHECK-NEXT: [[AND1:%.*]] = and <2 x i8> [[X]], <i8 poison, i8 3>
190- ; CHECK-NEXT: [[COND:%.*]] = select <2 x i1> [[CMP]], <2 x i8> [[AND1]], <2 x i8> <i8 1, i8 1>
175+ ; CHECK-NEXT: [[COND:%.*]] = select <2 x i1> [[CMP]], <2 x i8> <i8 3, i8 3>, <2 x i8> <i8 1, i8 1>
191176; CHECK-NEXT: ret <2 x i8> [[COND]]
192177;
193178 %and = and <2 x i8 > %y , <i8 poison, i8 12 >
@@ -202,8 +187,7 @@ define <2 x i8> @src_xor_bit_vec_poison2(<2 x i8> %x, <2 x i8> %y) {
202187; CHECK-NEXT: [[AND:%.*]] = and <2 x i8> [[Y:%.*]], <i8 poison, i8 12>
203188; CHECK-NEXT: [[XOR:%.*]] = xor <2 x i8> [[AND]], [[X:%.*]]
204189; CHECK-NEXT: [[CMP:%.*]] = icmp eq <2 x i8> [[XOR]], <i8 3, i8 3>
205- ; CHECK-NEXT: [[AND1:%.*]] = and <2 x i8> [[X]], <i8 3, i8 3>
206- ; CHECK-NEXT: [[COND:%.*]] = select <2 x i1> [[CMP]], <2 x i8> [[AND1]], <2 x i8> <i8 1, i8 1>
190+ ; CHECK-NEXT: [[COND:%.*]] = select <2 x i1> [[CMP]], <2 x i8> <i8 3, i8 3>, <2 x i8> <i8 1, i8 1>
207191; CHECK-NEXT: ret <2 x i8> [[COND]]
208192;
209193 %and = and <2 x i8 > %y , <i8 poison, i8 12 >
0 commit comments