@@ -56,8 +56,7 @@ define i1 @cond_eq_or_const(i8 %X, i8 %Y) {
56
56
define i1 @merge_and (i1 %X , i1 %Y ) {
57
57
; CHECK-LABEL: @merge_and(
58
58
; CHECK-NEXT: [[C:%.*]] = select i1 [[X:%.*]], i1 [[Y:%.*]], i1 false
59
- ; CHECK-NEXT: [[RES:%.*]] = and i1 [[C]], [[X]]
60
- ; CHECK-NEXT: ret i1 [[RES]]
59
+ ; CHECK-NEXT: ret i1 [[C]]
61
60
;
62
61
%c = select i1 %X , i1 %Y , i1 false
63
62
%res = and i1 %X , %c
@@ -67,8 +66,7 @@ define i1 @merge_and(i1 %X, i1 %Y) {
67
66
define i1 @merge_or (i1 %X , i1 %Y ) {
68
67
; CHECK-LABEL: @merge_or(
69
68
; CHECK-NEXT: [[C:%.*]] = select i1 [[X:%.*]], i1 true, i1 [[Y:%.*]]
70
- ; CHECK-NEXT: [[RES:%.*]] = or i1 [[C]], [[X]]
71
- ; CHECK-NEXT: ret i1 [[RES]]
69
+ ; CHECK-NEXT: ret i1 [[C]]
72
70
;
73
71
%c = select i1 %X , i1 true , i1 %Y
74
72
%res = or i1 %X , %c
@@ -77,10 +75,10 @@ define i1 @merge_or(i1 %X, i1 %Y) {
77
75
78
76
define i1 @xor_and (i1 %c , i32 %X , i32 %Y ) {
79
77
; CHECK-LABEL: @xor_and(
80
- ; CHECK-NEXT: [[COMP:%.*]] = icmp ult i32 [[X:%.*]], [[Y:%.*]]
81
- ; CHECK-NEXT: [[SEL :%.*]] = select i1 [[C:%.*]], i1 [[COMP]], i1 false
82
- ; CHECK-NEXT: [[RES :%.*]] = xor i1 [[SEL ]], true
83
- ; CHECK-NEXT: ret i1 [[RES ]]
78
+ ; CHECK-NEXT: [[COMP:%.*]] = icmp uge i32 [[X:%.*]], [[Y:%.*]]
79
+ ; CHECK-NEXT: [[NOT_C :%.*]] = xor i1 [[C:%.*]], true
80
+ ; CHECK-NEXT: [[SEL :%.*]] = select i1 [[NOT_C ]], i1 true, i1 [[COMP]]
81
+ ; CHECK-NEXT: ret i1 [[SEL ]]
84
82
;
85
83
%comp = icmp ult i32 %X , %Y
86
84
%sel = select i1 %c , i1 %comp , i1 false
@@ -90,10 +88,9 @@ define i1 @xor_and(i1 %c, i32 %X, i32 %Y) {
90
88
91
89
define <2 x i1 > @xor_and2 (<2 x i1 > %c , <2 x i32 > %X , <2 x i32 > %Y ) {
92
90
; CHECK-LABEL: @xor_and2(
93
- ; CHECK-NEXT: [[COMP:%.*]] = icmp ult <2 x i32> [[X:%.*]], [[Y:%.*]]
94
- ; CHECK-NEXT: [[SEL:%.*]] = select <2 x i1> [[C:%.*]], <2 x i1> [[COMP]], <2 x i1> <i1 true, i1 false>
95
- ; CHECK-NEXT: [[RES:%.*]] = xor <2 x i1> [[SEL]], <i1 true, i1 true>
96
- ; CHECK-NEXT: ret <2 x i1> [[RES]]
91
+ ; CHECK-NEXT: [[COMP:%.*]] = icmp uge <2 x i32> [[X:%.*]], [[Y:%.*]]
92
+ ; CHECK-NEXT: [[SEL:%.*]] = select <2 x i1> [[C:%.*]], <2 x i1> [[COMP]], <2 x i1> <i1 false, i1 true>
93
+ ; CHECK-NEXT: ret <2 x i1> [[SEL]]
97
94
;
98
95
%comp = icmp ult <2 x i32 > %X , %Y
99
96
%sel = select <2 x i1 > %c , <2 x i1 > %comp , <2 x i1 > <i1 true , i1 false >
@@ -105,10 +102,9 @@ define <2 x i1> @xor_and2(<2 x i1> %c, <2 x i32> %X, <2 x i32> %Y) {
105
102
106
103
define <2 x i1 > @xor_and3 (<2 x i1 > %c , <2 x i32 > %X , <2 x i32 > %Y ) {
107
104
; CHECK-LABEL: @xor_and3(
108
- ; CHECK-NEXT: [[COMP:%.*]] = icmp ult <2 x i32> [[X:%.*]], [[Y:%.*]]
109
- ; CHECK-NEXT: [[SEL:%.*]] = select <2 x i1> [[C:%.*]], <2 x i1> [[COMP]], <2 x i1> <i1 icmp eq (i8* inttoptr (i64 1234 to i8*), i8* @glb), i1 false>
110
- ; CHECK-NEXT: [[RES:%.*]] = xor <2 x i1> [[SEL]], <i1 true, i1 true>
111
- ; CHECK-NEXT: ret <2 x i1> [[RES]]
105
+ ; CHECK-NEXT: [[COMP:%.*]] = icmp uge <2 x i32> [[X:%.*]], [[Y:%.*]]
106
+ ; CHECK-NEXT: [[SEL:%.*]] = select <2 x i1> [[C:%.*]], <2 x i1> [[COMP]], <2 x i1> <i1 icmp ne (i8* inttoptr (i64 1234 to i8*), i8* @glb), i1 true>
107
+ ; CHECK-NEXT: ret <2 x i1> [[SEL]]
112
108
;
113
109
%comp = icmp ult <2 x i32 > %X , %Y
114
110
%sel = select <2 x i1 > %c , <2 x i1 > %comp , <2 x i1 > <i1 icmp eq (i8* @glb , i8* inttoptr (i64 1234 to i8* )), i1 false >
@@ -118,10 +114,10 @@ define <2 x i1> @xor_and3(<2 x i1> %c, <2 x i32> %X, <2 x i32> %Y) {
118
114
119
115
define i1 @xor_or (i1 %c , i32 %X , i32 %Y ) {
120
116
; CHECK-LABEL: @xor_or(
121
- ; CHECK-NEXT: [[COMP:%.*]] = icmp ult i32 [[X:%.*]], [[Y:%.*]]
122
- ; CHECK-NEXT: [[SEL :%.*]] = select i1 [[C:%.*]], i1 true, i1 [[COMP]]
123
- ; CHECK-NEXT: [[RES :%.*]] = xor i1 [[SEL ]], true
124
- ; CHECK-NEXT: ret i1 [[RES ]]
117
+ ; CHECK-NEXT: [[COMP:%.*]] = icmp uge i32 [[X:%.*]], [[Y:%.*]]
118
+ ; CHECK-NEXT: [[NOT_C :%.*]] = xor i1 [[C:%.*]], true
119
+ ; CHECK-NEXT: [[SEL :%.*]] = select i1 [[NOT_C ]], i1 [[COMP]], i1 false
120
+ ; CHECK-NEXT: ret i1 [[SEL ]]
125
121
;
126
122
%comp = icmp ult i32 %X , %Y
127
123
%sel = select i1 %c , i1 true , i1 %comp
@@ -131,10 +127,9 @@ define i1 @xor_or(i1 %c, i32 %X, i32 %Y) {
131
127
132
128
define <2 x i1 > @xor_or2 (<2 x i1 > %c , <2 x i32 > %X , <2 x i32 > %Y ) {
133
129
; CHECK-LABEL: @xor_or2(
134
- ; CHECK-NEXT: [[COMP:%.*]] = icmp ult <2 x i32> [[X:%.*]], [[Y:%.*]]
135
- ; CHECK-NEXT: [[SEL:%.*]] = select <2 x i1> [[C:%.*]], <2 x i1> <i1 true, i1 false>, <2 x i1> [[COMP]]
136
- ; CHECK-NEXT: [[RES:%.*]] = xor <2 x i1> [[SEL]], <i1 true, i1 true>
137
- ; CHECK-NEXT: ret <2 x i1> [[RES]]
130
+ ; CHECK-NEXT: [[COMP:%.*]] = icmp uge <2 x i32> [[X:%.*]], [[Y:%.*]]
131
+ ; CHECK-NEXT: [[SEL:%.*]] = select <2 x i1> [[C:%.*]], <2 x i1> <i1 false, i1 true>, <2 x i1> [[COMP]]
132
+ ; CHECK-NEXT: ret <2 x i1> [[SEL]]
138
133
;
139
134
%comp = icmp ult <2 x i32 > %X , %Y
140
135
%sel = select <2 x i1 > %c , <2 x i1 > <i1 true , i1 false >, <2 x i1 > %comp
@@ -144,10 +139,9 @@ define <2 x i1> @xor_or2(<2 x i1> %c, <2 x i32> %X, <2 x i32> %Y) {
144
139
145
140
define <2 x i1 > @xor_or3 (<2 x i1 > %c , <2 x i32 > %X , <2 x i32 > %Y ) {
146
141
; CHECK-LABEL: @xor_or3(
147
- ; CHECK-NEXT: [[COMP:%.*]] = icmp ult <2 x i32> [[X:%.*]], [[Y:%.*]]
148
- ; CHECK-NEXT: [[SEL:%.*]] = select <2 x i1> [[C:%.*]], <2 x i1> <i1 icmp eq (i8* inttoptr (i64 1234 to i8*), i8* @glb), i1 false>, <2 x i1> [[COMP]]
149
- ; CHECK-NEXT: [[RES:%.*]] = xor <2 x i1> [[SEL]], <i1 true, i1 true>
150
- ; CHECK-NEXT: ret <2 x i1> [[RES]]
142
+ ; CHECK-NEXT: [[COMP:%.*]] = icmp uge <2 x i32> [[X:%.*]], [[Y:%.*]]
143
+ ; CHECK-NEXT: [[SEL:%.*]] = select <2 x i1> [[C:%.*]], <2 x i1> <i1 icmp ne (i8* inttoptr (i64 1234 to i8*), i8* @glb), i1 true>, <2 x i1> [[COMP]]
144
+ ; CHECK-NEXT: ret <2 x i1> [[SEL]]
151
145
;
152
146
%comp = icmp ult <2 x i32 > %X , %Y
153
147
%sel = select <2 x i1 > %c , <2 x i1 > <i1 icmp eq (i8* @glb , i8* inttoptr (i64 1234 to i8* )), i1 false >, <2 x i1 > %comp
0 commit comments