@@ -270,12 +270,12 @@ define i32 @test1_ands(i32 %a) {
270270; CHECK: // %bb.0: // %entry
271271; CHECK-NEXT: and w8, w0, #0x3ffc00
272272; CHECK-NEXT: ands w8, w8, #0xffe007ff
273- ; CHECK-NEXT: csel w0, w8, wzr , eq
273+ ; CHECK-NEXT: csel w0, w0, w8 , eq
274274; CHECK-NEXT: ret
275275entry:
276276 %ands = and i32 %a , 2098176
277277 %c = icmp eq i32 %ands , 0
278- %r = select i1 %c , i32 %ands , i32 0
278+ %r = select i1 %c , i32 %a , i32 %ands
279279 ret i32 %r
280280}
281281
@@ -285,12 +285,12 @@ define i32 @test2_ands(i32 %a) {
285285; CHECK: // %bb.0: // %entry
286286; CHECK-NEXT: mov w8, #135 // =0x87
287287; CHECK-NEXT: ands w8, w0, w8
288- ; CHECK-NEXT: csel w0, w8, wzr , eq
288+ ; CHECK-NEXT: csel w0, w0, w8 , eq
289289; CHECK-NEXT: ret
290290entry:
291291 %ands = and i32 %a , 135
292292 %c = icmp eq i32 %ands , 0
293- %r = select i1 %c , i32 %ands , i32 0
293+ %r = select i1 %c , i32 %a , i32 %ands
294294 ret i32 %r
295295}
296296
@@ -302,12 +302,12 @@ define i32 @test3_ands(i32 %a) {
302302; CHECK-NEXT: mov w8, #1024 // =0x400
303303; CHECK-NEXT: movk w8, #33, lsl #16
304304; CHECK-NEXT: ands w8, w0, w8
305- ; CHECK-NEXT: csel w0, w8, wzr , eq
305+ ; CHECK-NEXT: csel w0, w0, w8 , eq
306306; CHECK-NEXT: ret
307307entry:
308308 %ands = and i32 %a , 2163712
309309 %c = icmp eq i32 %ands , 0
310- %r = select i1 %c , i32 %ands , i32 0
310+ %r = select i1 %c , i32 %a , i32 %ands
311311 ret i32 %r
312312}
313313
@@ -316,12 +316,12 @@ define i64 @test4_ands(i64 %a) {
316316; CHECK: // %bb.0: // %entry
317317; CHECK-NEXT: and x8, x0, #0x3ffc00
318318; CHECK-NEXT: ands x8, x8, #0xffffffffffe007ff
319- ; CHECK-NEXT: csel x0, x8, xzr , eq
319+ ; CHECK-NEXT: csel x0, x0, x8 , eq
320320; CHECK-NEXT: ret
321321entry:
322322 %ands = and i64 %a , 2098176
323323 %c = icmp eq i64 %ands , 0
324- %r = select i1 %c , i64 %ands , i64 0
324+ %r = select i1 %c , i64 %a , i64 %ands
325325 ret i64 %r
326326}
327327
@@ -330,12 +330,12 @@ define i64 @test5_ands(i64 %a) {
330330; CHECK: // %bb.0: // %entry
331331; CHECK-NEXT: and x8, x0, #0x3ffffc000
332332; CHECK-NEXT: ands x8, x8, #0xfffffffe00007fff
333- ; CHECK-NEXT: csel x0, x8, xzr , eq
333+ ; CHECK-NEXT: csel x0, x0, x8 , eq
334334; CHECK-NEXT: ret
335335entry:
336336 %ands = and i64 %a , 8589950976
337337 %c = icmp eq i64 %ands , 0
338- %r = select i1 %c , i64 %ands , i64 0
338+ %r = select i1 %c , i64 %a , i64 %ands
339339 ret i64 %r
340340}
341341
@@ -345,12 +345,12 @@ define i64 @test6_ands(i64 %a) {
345345; CHECK: // %bb.0: // %entry
346346; CHECK-NEXT: mov w8, #135 // =0x87
347347; CHECK-NEXT: ands x8, x0, x8
348- ; CHECK-NEXT: csel x0, x8, xzr , eq
348+ ; CHECK-NEXT: csel x0, x0, x8 , eq
349349; CHECK-NEXT: ret
350350entry:
351351 %ands = and i64 %a , 135
352352 %c = icmp eq i64 %ands , 0
353- %r = select i1 %c , i64 %ands , i64 0
353+ %r = select i1 %c , i64 %a , i64 %ands
354354 ret i64 %r
355355}
356356
@@ -362,11 +362,11 @@ define i64 @test7_ands(i64 %a) {
362362; CHECK-NEXT: mov w8, #1024 // =0x400
363363; CHECK-NEXT: movk w8, #33, lsl #16
364364; CHECK-NEXT: ands x8, x0, x8
365- ; CHECK-NEXT: csel x0, x8, xzr , eq
365+ ; CHECK-NEXT: csel x0, x0, x8 , eq
366366; CHECK-NEXT: ret
367367entry:
368368 %ands = and i64 %a , 2163712
369369 %c = icmp eq i64 %ands , 0
370- %r = select i1 %c , i64 %ands , i64 0
370+ %r = select i1 %c , i64 %a , i64 %ands
371371 ret i64 %r
372372}
0 commit comments