@@ -453,9 +453,8 @@ define i1 @demorgan_select_infloop2(i1 %L) {
453
453
454
454
define i1 @and_or1 (i1 %a , i1 %b , i1 %c ) {
455
455
; CHECK-LABEL: @and_or1(
456
- ; CHECK-NEXT: [[TMP1:%.*]] = freeze i1 [[B:%.*]]
457
- ; CHECK-NEXT: [[TMP2:%.*]] = or i1 [[TMP1]], [[C:%.*]]
458
- ; CHECK-NEXT: [[R:%.*]] = and i1 [[TMP2]], [[A:%.*]]
456
+ ; CHECK-NEXT: [[TMP1:%.*]] = select i1 [[C:%.*]], i1 true, i1 [[B:%.*]]
457
+ ; CHECK-NEXT: [[R:%.*]] = select i1 [[A:%.*]], i1 [[TMP1]], i1 false
459
458
; CHECK-NEXT: ret i1 [[R]]
460
459
;
461
460
%nota = xor i1 %a , true
@@ -466,9 +465,8 @@ define i1 @and_or1(i1 %a, i1 %b, i1 %c) {
466
465
467
466
define i1 @and_or2 (i1 %a , i1 %b , i1 %c ) {
468
467
; CHECK-LABEL: @and_or2(
469
- ; CHECK-NEXT: [[TMP1:%.*]] = freeze i1 [[A:%.*]]
470
- ; CHECK-NEXT: [[TMP2:%.*]] = or i1 [[TMP1]], [[C:%.*]]
471
- ; CHECK-NEXT: [[R:%.*]] = and i1 [[TMP2]], [[B:%.*]]
468
+ ; CHECK-NEXT: [[TMP1:%.*]] = select i1 [[C:%.*]], i1 true, i1 [[A:%.*]]
469
+ ; CHECK-NEXT: [[R:%.*]] = select i1 [[B:%.*]], i1 [[TMP1]], i1 false
472
470
; CHECK-NEXT: ret i1 [[R]]
473
471
;
474
472
%notc = xor i1 %c , true
@@ -479,9 +477,8 @@ define i1 @and_or2(i1 %a, i1 %b, i1 %c) {
479
477
480
478
define i1 @and_or1_commuted (i1 %a , i1 %b , i1 %c ) {
481
479
; CHECK-LABEL: @and_or1_commuted(
482
- ; CHECK-NEXT: [[TMP1:%.*]] = freeze i1 [[B:%.*]]
483
- ; CHECK-NEXT: [[TMP2:%.*]] = or i1 [[TMP1]], [[C:%.*]]
484
- ; CHECK-NEXT: [[R:%.*]] = and i1 [[TMP2]], [[A:%.*]]
480
+ ; CHECK-NEXT: [[TMP1:%.*]] = select i1 [[C:%.*]], i1 true, i1 [[B:%.*]]
481
+ ; CHECK-NEXT: [[R:%.*]] = select i1 [[A:%.*]], i1 [[TMP1]], i1 false
485
482
; CHECK-NEXT: ret i1 [[R]]
486
483
;
487
484
%nota = xor i1 %a , true
@@ -492,9 +489,8 @@ define i1 @and_or1_commuted(i1 %a, i1 %b, i1 %c) {
492
489
493
490
define i1 @and_or2_commuted (i1 %a , i1 %b , i1 %c ) {
494
491
; CHECK-LABEL: @and_or2_commuted(
495
- ; CHECK-NEXT: [[TMP1:%.*]] = freeze i1 [[A:%.*]]
496
- ; CHECK-NEXT: [[TMP2:%.*]] = or i1 [[TMP1]], [[C:%.*]]
497
- ; CHECK-NEXT: [[R:%.*]] = and i1 [[TMP2]], [[B:%.*]]
492
+ ; CHECK-NEXT: [[TMP1:%.*]] = select i1 [[C:%.*]], i1 true, i1 [[A:%.*]]
493
+ ; CHECK-NEXT: [[R:%.*]] = select i1 [[B:%.*]], i1 [[TMP1]], i1 false
498
494
; CHECK-NEXT: ret i1 [[R]]
499
495
;
500
496
%notc = xor i1 %c , true
@@ -536,9 +532,8 @@ define i1 @and_or2_multiuse(i1 %a, i1 %b, i1 %c) {
536
532
define <2 x i1 > @and_or1_vec (<2 x i1 > %a , <2 x i1 > %b ) {
537
533
; CHECK-LABEL: @and_or1_vec(
538
534
; CHECK-NEXT: [[C:%.*]] = call <2 x i1> @gen_v2i1()
539
- ; CHECK-NEXT: [[TMP1:%.*]] = freeze <2 x i1> [[B:%.*]]
540
- ; CHECK-NEXT: [[TMP2:%.*]] = or <2 x i1> [[C]], [[TMP1]]
541
- ; CHECK-NEXT: [[R:%.*]] = and <2 x i1> [[TMP2]], [[A:%.*]]
535
+ ; CHECK-NEXT: [[TMP1:%.*]] = select <2 x i1> [[C]], <2 x i1> <i1 true, i1 true>, <2 x i1> [[B:%.*]]
536
+ ; CHECK-NEXT: [[R:%.*]] = select <2 x i1> [[A:%.*]], <2 x i1> [[TMP1]], <2 x i1> zeroinitializer
542
537
; CHECK-NEXT: ret <2 x i1> [[R]]
543
538
;
544
539
%c = call <2 x i1 > @gen_v2i1 ()
@@ -551,9 +546,8 @@ define <2 x i1> @and_or1_vec(<2 x i1> %a, <2 x i1> %b) {
551
546
define <2 x i1 > @and_or2_vec (<2 x i1 > %a , <2 x i1 > %b ) {
552
547
; CHECK-LABEL: @and_or2_vec(
553
548
; CHECK-NEXT: [[C:%.*]] = call <2 x i1> @gen_v2i1()
554
- ; CHECK-NEXT: [[TMP1:%.*]] = freeze <2 x i1> [[A:%.*]]
555
- ; CHECK-NEXT: [[TMP2:%.*]] = or <2 x i1> [[C]], [[TMP1]]
556
- ; CHECK-NEXT: [[R:%.*]] = and <2 x i1> [[TMP2]], [[B:%.*]]
549
+ ; CHECK-NEXT: [[TMP1:%.*]] = select <2 x i1> [[C]], <2 x i1> <i1 true, i1 true>, <2 x i1> [[A:%.*]]
550
+ ; CHECK-NEXT: [[R:%.*]] = select <2 x i1> [[B:%.*]], <2 x i1> [[TMP1]], <2 x i1> zeroinitializer
557
551
; CHECK-NEXT: ret <2 x i1> [[R]]
558
552
;
559
553
%c = call <2 x i1 > @gen_v2i1 ()
@@ -566,9 +560,8 @@ define <2 x i1> @and_or2_vec(<2 x i1> %a, <2 x i1> %b) {
566
560
define <2 x i1 > @and_or1_vec_commuted (<2 x i1 > %a , <2 x i1 > %b ) {
567
561
; CHECK-LABEL: @and_or1_vec_commuted(
568
562
; CHECK-NEXT: [[C:%.*]] = call <2 x i1> @gen_v2i1()
569
- ; CHECK-NEXT: [[TMP1:%.*]] = freeze <2 x i1> [[B:%.*]]
570
- ; CHECK-NEXT: [[TMP2:%.*]] = or <2 x i1> [[C]], [[TMP1]]
571
- ; CHECK-NEXT: [[R:%.*]] = and <2 x i1> [[TMP2]], [[A:%.*]]
563
+ ; CHECK-NEXT: [[TMP1:%.*]] = select <2 x i1> [[C]], <2 x i1> <i1 true, i1 true>, <2 x i1> [[B:%.*]]
564
+ ; CHECK-NEXT: [[R:%.*]] = select <2 x i1> [[A:%.*]], <2 x i1> [[TMP1]], <2 x i1> zeroinitializer
572
565
; CHECK-NEXT: ret <2 x i1> [[R]]
573
566
;
574
567
%c = call <2 x i1 > @gen_v2i1 ()
@@ -581,9 +574,8 @@ define <2 x i1> @and_or1_vec_commuted(<2 x i1> %a, <2 x i1> %b) {
581
574
define <2 x i1 > @and_or2_vec_commuted (<2 x i1 > %a , <2 x i1 > %b ) {
582
575
; CHECK-LABEL: @and_or2_vec_commuted(
583
576
; CHECK-NEXT: [[C:%.*]] = call <2 x i1> @gen_v2i1()
584
- ; CHECK-NEXT: [[TMP1:%.*]] = freeze <2 x i1> [[A:%.*]]
585
- ; CHECK-NEXT: [[TMP2:%.*]] = or <2 x i1> [[C]], [[TMP1]]
586
- ; CHECK-NEXT: [[R:%.*]] = and <2 x i1> [[TMP2]], [[B:%.*]]
577
+ ; CHECK-NEXT: [[TMP1:%.*]] = select <2 x i1> [[C]], <2 x i1> <i1 true, i1 true>, <2 x i1> [[A:%.*]]
578
+ ; CHECK-NEXT: [[R:%.*]] = select <2 x i1> [[B:%.*]], <2 x i1> [[TMP1]], <2 x i1> zeroinitializer
587
579
; CHECK-NEXT: ret <2 x i1> [[R]]
588
580
;
589
581
%c = call <2 x i1 > @gen_v2i1 ()
@@ -621,9 +613,9 @@ define i1 @and_or2_wrong_operand(i1 %a, i1 %b, i1 %c, i1 %d) {
621
613
622
614
define i1 @and_or3 (i1 %a , i1 %b , i32 %x , i32 %y ) {
623
615
; CHECK-LABEL: @and_or3(
624
- ; CHECK-NEXT: [[C:%.*]] = icmp eq i32 [[X:%.*]], [[Y:%.*]]
625
- ; CHECK-NEXT: [[COND :%.*]] = and i1 [[C]], [[B :%.*]]
626
- ; CHECK-NEXT: [[R:%.*]] = select i1 [[COND]], i1 [[A :%.*]], i1 [[B]]
616
+ ; CHECK-NEXT: [[C:%.*]] = icmp ne i32 [[X:%.*]], [[Y:%.*]]
617
+ ; CHECK-NEXT: [[TMP1 :%.*]] = select i1 [[C]], i1 true, i1 [[A :%.*]]
618
+ ; CHECK-NEXT: [[R:%.*]] = select i1 [[B :%.*]], i1 [[TMP1]], i1 false
627
619
; CHECK-NEXT: ret i1 [[R]]
628
620
;
629
621
%c = icmp eq i32 %x , %y
@@ -634,9 +626,9 @@ define i1 @and_or3(i1 %a, i1 %b, i32 %x, i32 %y) {
634
626
635
627
define i1 @and_or3_commuted (i1 %a , i1 %b , i32 %x , i32 %y ) {
636
628
; CHECK-LABEL: @and_or3_commuted(
637
- ; CHECK-NEXT: [[C:%.*]] = icmp eq i32 [[X:%.*]], [[Y:%.*]]
638
- ; CHECK-NEXT: [[COND :%.*]] = and i1 [[C]], [[B :%.*]]
639
- ; CHECK-NEXT: [[R:%.*]] = select i1 [[COND]], i1 [[A :%.*]], i1 [[B]]
629
+ ; CHECK-NEXT: [[C:%.*]] = icmp ne i32 [[X:%.*]], [[Y:%.*]]
630
+ ; CHECK-NEXT: [[TMP1 :%.*]] = select i1 [[C]], i1 true, i1 [[A :%.*]]
631
+ ; CHECK-NEXT: [[R:%.*]] = select i1 [[B :%.*]], i1 [[TMP1]], i1 false
640
632
; CHECK-NEXT: ret i1 [[R]]
641
633
;
642
634
%c = icmp eq i32 %x , %y
@@ -673,9 +665,9 @@ define i1 @and_or3_multiuse(i1 %a, i1 %b, i32 %x, i32 %y) {
673
665
674
666
define <2 x i1 > @and_or3_vec (<2 x i1 > %a , <2 x i1 > %b , <2 x i32 > %x , <2 x i32 > %y ) {
675
667
; CHECK-LABEL: @and_or3_vec(
676
- ; CHECK-NEXT: [[C:%.*]] = icmp eq <2 x i32> [[X:%.*]], [[Y:%.*]]
677
- ; CHECK-NEXT: [[COND :%.*]] = and <2 x i1> [[C]], [[B :%.*]]
678
- ; CHECK-NEXT: [[R:%.*]] = select <2 x i1> [[COND ]], <2 x i1> [[A:%.* ]], <2 x i1> [[B]]
668
+ ; CHECK-NEXT: [[C:%.*]] = icmp ne <2 x i32> [[X:%.*]], [[Y:%.*]]
669
+ ; CHECK-NEXT: [[TMP1 :%.*]] = select <2 x i1> [[C]], <2 x i1> <i1 true, i1 true>, <2 x i1> [[A :%.*]]
670
+ ; CHECK-NEXT: [[R:%.*]] = select <2 x i1> [[B:%.* ]], <2 x i1> [[TMP1 ]], <2 x i1> zeroinitializer
679
671
; CHECK-NEXT: ret <2 x i1> [[R]]
680
672
;
681
673
%c = icmp eq <2 x i32 > %x , %y
@@ -686,9 +678,9 @@ define <2 x i1> @and_or3_vec(<2 x i1> %a, <2 x i1> %b, <2 x i32> %x, <2 x i32> %
686
678
687
679
define <2 x i1 > @and_or3_vec_commuted (<2 x i1 > %a , <2 x i1 > %b , <2 x i32 > %x , <2 x i32 > %y ) {
688
680
; CHECK-LABEL: @and_or3_vec_commuted(
689
- ; CHECK-NEXT: [[C:%.*]] = icmp eq <2 x i32> [[X:%.*]], [[Y:%.*]]
690
- ; CHECK-NEXT: [[COND :%.*]] = and <2 x i1> [[C]], [[B :%.*]]
691
- ; CHECK-NEXT: [[R:%.*]] = select <2 x i1> [[COND ]], <2 x i1> [[A:%.* ]], <2 x i1> [[B]]
681
+ ; CHECK-NEXT: [[C:%.*]] = icmp ne <2 x i32> [[X:%.*]], [[Y:%.*]]
682
+ ; CHECK-NEXT: [[TMP1 :%.*]] = select <2 x i1> [[C]], <2 x i1> <i1 true, i1 true>, <2 x i1> [[A :%.*]]
683
+ ; CHECK-NEXT: [[R:%.*]] = select <2 x i1> [[B:%.* ]], <2 x i1> [[TMP1 ]], <2 x i1> zeroinitializer
692
684
; CHECK-NEXT: ret <2 x i1> [[R]]
693
685
;
694
686
%c = icmp eq <2 x i32 > %x , %y
0 commit comments