xref: /llvm-project/llvm/test/Transforms/InstCombine/select-value-equivalence.ll (revision 7bbc049688a1586827d87ad8e2fc7cb3638ef2fc)
1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
2; RUN: opt -passes=instcombine -S %s | FileCheck %s
3
4define <2 x i8> @select_icmp_insertelement_eq(<2 x i8> %x, <2 x i8> %y, i8 %i) {
5; CHECK-LABEL: define <2 x i8> @select_icmp_insertelement_eq(
6; CHECK-SAME: <2 x i8> [[X:%.*]], <2 x i8> [[Y:%.*]], i8 [[I:%.*]]) {
7; CHECK-NEXT:    [[CMP:%.*]] = icmp eq <2 x i8> [[Y]], splat (i8 2)
8; CHECK-NEXT:    [[INSERT:%.*]] = insertelement <2 x i8> splat (i8 2), i8 0, i8 [[I]]
9; CHECK-NEXT:    [[RETVAL:%.*]] = select <2 x i1> [[CMP]], <2 x i8> [[INSERT]], <2 x i8> [[X]]
10; CHECK-NEXT:    ret <2 x i8> [[RETVAL]]
11;
12  %cmp = icmp eq <2 x i8> %y, <i8 2, i8 2>
13  %insert = insertelement <2 x i8> %y, i8 0, i8 %i
14  %retval = select <2 x i1> %cmp, <2 x i8> %insert, <2 x i8> %x
15  ret <2 x i8> %retval
16}
17
18define <2 x i8> @select_icmp_insertelement_ne(<2 x i8> %x, <2 x i8> %y, i8 %i) {
19; CHECK-LABEL: define <2 x i8> @select_icmp_insertelement_ne(
20; CHECK-SAME: <2 x i8> [[X:%.*]], <2 x i8> [[Y:%.*]], i8 [[I:%.*]]) {
21; CHECK-NEXT:    [[CMP_NOT:%.*]] = icmp eq <2 x i8> [[Y]], splat (i8 2)
22; CHECK-NEXT:    [[INSERT:%.*]] = insertelement <2 x i8> splat (i8 2), i8 0, i8 [[I]]
23; CHECK-NEXT:    [[RETVAL:%.*]] = select <2 x i1> [[CMP_NOT]], <2 x i8> [[INSERT]], <2 x i8> [[X]]
24; CHECK-NEXT:    ret <2 x i8> [[RETVAL]]
25;
26  %cmp = icmp ne <2 x i8> %y, <i8 2, i8 2>
27  %insert = insertelement <2 x i8> %y, i8 0, i8 %i
28  %retval = select <2 x i1> %cmp, <2 x i8> %x, <2 x i8> %insert
29  ret <2 x i8> %retval
30}
31
32define <2 x i8> @select_icmp_shufflevector_identity(<2 x i8> %x, <2 x i8> %y) {
33; CHECK-LABEL: define <2 x i8> @select_icmp_shufflevector_identity(
34; CHECK-SAME: <2 x i8> [[X:%.*]], <2 x i8> [[Y:%.*]]) {
35; CHECK-NEXT:    [[CMP:%.*]] = icmp eq <2 x i8> [[Y]], splat (i8 2)
36; CHECK-NEXT:    [[RETVAL:%.*]] = select <2 x i1> [[CMP]], <2 x i8> splat (i8 2), <2 x i8> [[X]]
37; CHECK-NEXT:    ret <2 x i8> [[RETVAL]]
38;
39  %cmp = icmp eq <2 x i8> %y, <i8 2, i8 2>
40  %shuffle = shufflevector <2 x i8> %y, <2 x i8> poison, <2 x i32> <i32 0, i32 1>
41  %retval = select <2 x i1> %cmp, <2 x i8> %shuffle, <2 x i8> %x
42  ret <2 x i8> %retval
43}
44
45define <4 x i8> @select_icmp_shufflevector_select(<4 x i8> %x, <4 x i8> %y, <4 x i8> %z) {
46; CHECK-LABEL: define <4 x i8> @select_icmp_shufflevector_select(
47; CHECK-SAME: <4 x i8> [[X:%.*]], <4 x i8> [[Y:%.*]], <4 x i8> [[Z:%.*]]) {
48; CHECK-NEXT:    [[CMP:%.*]] = icmp eq <4 x i8> [[Y]], splat (i8 2)
49; CHECK-NEXT:    [[SHUFFLE:%.*]] = shufflevector <4 x i8> [[Z]], <4 x i8> <i8 poison, i8 2, i8 poison, i8 2>, <4 x i32> <i32 0, i32 5, i32 2, i32 7>
50; CHECK-NEXT:    [[RETVAL:%.*]] = select <4 x i1> [[CMP]], <4 x i8> [[SHUFFLE]], <4 x i8> [[X]]
51; CHECK-NEXT:    ret <4 x i8> [[RETVAL]]
52;
53  %cmp = icmp eq <4 x i8> %y, <i8 2, i8 2, i8 2, i8 2>
54  %shuffle = shufflevector <4 x i8> %y, <4 x i8> %z, <4 x i32> <i32 4, i32 1, i32 6, i32 3>
55  %retval = select <4 x i1> %cmp, <4 x i8> %shuffle, <4 x i8> %x
56  ret <4 x i8> %retval
57}
58
59define <2 x i8> @select_icmp_shufflevector_lanecrossing(<2 x i8> %x, <2 x i8> %y) {
60; CHECK-LABEL: define <2 x i8> @select_icmp_shufflevector_lanecrossing(
61; CHECK-SAME: <2 x i8> [[X:%.*]], <2 x i8> [[Y:%.*]]) {
62; CHECK-NEXT:    [[CMP:%.*]] = icmp eq <2 x i8> [[Y]], splat (i8 2)
63; CHECK-NEXT:    [[SHUFFLE:%.*]] = shufflevector <2 x i8> [[Y]], <2 x i8> poison, <2 x i32> <i32 1, i32 0>
64; CHECK-NEXT:    [[RETVAL:%.*]] = select <2 x i1> [[CMP]], <2 x i8> [[SHUFFLE]], <2 x i8> [[X]]
65; CHECK-NEXT:    ret <2 x i8> [[RETVAL]]
66;
67  %cmp = icmp eq <2 x i8> %y, <i8 2, i8 2>
68  %shuffle = shufflevector <2 x i8> %y, <2 x i8> poison, <2 x i32> <i32 1, i32 0>
69  %retval = select <2 x i1> %cmp, <2 x i8> %shuffle, <2 x i8> %x
70  ret <2 x i8> %retval
71}
72
73declare <2 x i8> @fn(<2 x i8>) speculatable
74
75define <2 x i8> @select_icmp_call_possibly_lanecrossing(<2 x i8> %x, <2 x i8> %y) {
76; CHECK-LABEL: define <2 x i8> @select_icmp_call_possibly_lanecrossing(
77; CHECK-SAME: <2 x i8> [[X:%.*]], <2 x i8> [[Y:%.*]]) {
78; CHECK-NEXT:    [[CMP:%.*]] = icmp eq <2 x i8> [[Y]], splat (i8 2)
79; CHECK-NEXT:    [[CALL:%.*]] = call <2 x i8> @fn(<2 x i8> [[Y]])
80; CHECK-NEXT:    [[RETVAL:%.*]] = select <2 x i1> [[CMP]], <2 x i8> [[CALL]], <2 x i8> [[X]]
81; CHECK-NEXT:    ret <2 x i8> [[RETVAL]]
82;
83  %cmp = icmp eq <2 x i8> %y, <i8 2, i8 2>
84  %call = call <2 x i8> @fn(<2 x i8> %y)
85  %retval = select <2 x i1> %cmp, <2 x i8> %call, <2 x i8> %x
86  ret <2 x i8> %retval
87}
88
89define float @select_fcmp_fadd_oeq_not_zero(float %x, float %y) {
90; CHECK-LABEL: define float @select_fcmp_fadd_oeq_not_zero(
91; CHECK-SAME: float [[X:%.*]], float [[Y:%.*]]) {
92; CHECK-NEXT:    [[FCMP:%.*]] = fcmp oeq float [[Y]], 2.000000e+00
93; CHECK-NEXT:    [[FADD:%.*]] = fadd float [[X]], 2.000000e+00
94; CHECK-NEXT:    [[RETVAL:%.*]] = select i1 [[FCMP]], float [[FADD]], float [[X]]
95; CHECK-NEXT:    ret float [[RETVAL]]
96;
97  %fcmp = fcmp oeq float %y, 2.0
98  %fadd = fadd float %x, %y
99  %retval = select i1 %fcmp, float %fadd, float %x
100  ret float %retval
101}
102
103define float @select_fcmp_fadd_une_not_zero(float %x, float %y) {
104; CHECK-LABEL: define float @select_fcmp_fadd_une_not_zero(
105; CHECK-SAME: float [[X:%.*]], float [[Y:%.*]]) {
106; CHECK-NEXT:    [[FCMP:%.*]] = fcmp une float [[Y]], 2.000000e+00
107; CHECK-NEXT:    [[FADD:%.*]] = fadd float [[X]], 2.000000e+00
108; CHECK-NEXT:    [[RETVAL:%.*]] = select i1 [[FCMP]], float [[X]], float [[FADD]]
109; CHECK-NEXT:    ret float [[RETVAL]]
110;
111  %fcmp = fcmp une float %y, 2.0
112  %fadd = fadd float %x, %y
113  %retval = select i1 %fcmp, float %x, float %fadd
114  ret float %retval
115}
116
117define float @select_fcmp_fadd_ueq_nnan_not_zero(float %x, float %y) {
118; CHECK-LABEL: define float @select_fcmp_fadd_ueq_nnan_not_zero(
119; CHECK-SAME: float [[X:%.*]], float [[Y:%.*]]) {
120; CHECK-NEXT:    [[FCMP:%.*]] = fcmp nnan ueq float [[Y]], 2.000000e+00
121; CHECK-NEXT:    [[FADD:%.*]] = fadd float [[X]], 2.000000e+00
122; CHECK-NEXT:    [[RETVAL:%.*]] = select i1 [[FCMP]], float [[FADD]], float [[X]]
123; CHECK-NEXT:    ret float [[RETVAL]]
124;
125  %fcmp = fcmp nnan ueq float %y, 2.0
126  %fadd = fadd float %x, %y
127  %retval = select i1 %fcmp, float %fadd, float %x
128  ret float %retval
129}
130
131define float @select_fcmp_fadd_one_nnan_not_zero(float %x, float %y) {
132; CHECK-LABEL: define float @select_fcmp_fadd_one_nnan_not_zero(
133; CHECK-SAME: float [[X:%.*]], float [[Y:%.*]]) {
134; CHECK-NEXT:    [[FCMP:%.*]] = fcmp nnan one float [[Y]], 2.000000e+00
135; CHECK-NEXT:    [[FADD:%.*]] = fadd float [[X]], 2.000000e+00
136; CHECK-NEXT:    [[RETVAL:%.*]] = select i1 [[FCMP]], float [[X]], float [[FADD]]
137; CHECK-NEXT:    ret float [[RETVAL]]
138;
139  %fcmp = fcmp nnan one float %y, 2.0
140  %fadd = fadd float %x, %y
141  %retval = select i1 %fcmp, float %x, float %fadd
142  ret float %retval
143}
144
145define float @select_fcmp_fadd_ueq(float %x, float %y) {
146; CHECK-LABEL: define float @select_fcmp_fadd_ueq(
147; CHECK-SAME: float [[X:%.*]], float [[Y:%.*]]) {
148; CHECK-NEXT:    [[FCMP:%.*]] = fcmp ueq float [[Y]], 2.000000e+00
149; CHECK-NEXT:    [[FADD:%.*]] = fadd float [[X]], [[Y]]
150; CHECK-NEXT:    [[RETVAL:%.*]] = select i1 [[FCMP]], float [[FADD]], float [[X]]
151; CHECK-NEXT:    ret float [[RETVAL]]
152;
153  %fcmp = fcmp ueq float %y, 2.0
154  %fadd = fadd float %x, %y
155  %retval = select i1 %fcmp, float %fadd, float %x
156  ret float %retval
157}
158
159define float @select_fcmp_fadd_one(float %x, float %y) {
160; CHECK-LABEL: define float @select_fcmp_fadd_one(
161; CHECK-SAME: float [[X:%.*]], float [[Y:%.*]]) {
162; CHECK-NEXT:    [[FCMP:%.*]] = fcmp one float [[Y]], 2.000000e+00
163; CHECK-NEXT:    [[FADD:%.*]] = fadd float [[X]], [[Y]]
164; CHECK-NEXT:    [[RETVAL:%.*]] = select i1 [[FCMP]], float [[X]], float [[FADD]]
165; CHECK-NEXT:    ret float [[RETVAL]]
166;
167  %fcmp = fcmp one float %y, 2.0
168  %fadd = fadd float %x, %y
169  %retval = select i1 %fcmp, float %x, float %fadd
170  ret float %retval
171}
172
173define float @select_fcmp_fadd_oeq_zero(float %x, float %y) {
174; CHECK-LABEL: define float @select_fcmp_fadd_oeq_zero(
175; CHECK-SAME: float [[X:%.*]], float [[Y:%.*]]) {
176; CHECK-NEXT:    [[FCMP:%.*]] = fcmp oeq float [[Y]], 0.000000e+00
177; CHECK-NEXT:    [[FADD:%.*]] = fadd float [[X]], [[Y]]
178; CHECK-NEXT:    [[RETVAL:%.*]] = select i1 [[FCMP]], float [[FADD]], float [[X]]
179; CHECK-NEXT:    ret float [[RETVAL]]
180;
181  %fcmp = fcmp oeq float %y, 0.0
182  %fadd = fadd float %x, %y
183  %retval = select i1 %fcmp, float %fadd, float %x
184  ret float %retval
185}
186
187define float @select_fcmp_fadd_une_zero(float %x, float %y) {
188; CHECK-LABEL: define float @select_fcmp_fadd_une_zero(
189; CHECK-SAME: float [[X:%.*]], float [[Y:%.*]]) {
190; CHECK-NEXT:    [[FCMP:%.*]] = fcmp une float [[Y]], 0.000000e+00
191; CHECK-NEXT:    [[FADD:%.*]] = fadd float [[X]], [[Y]]
192; CHECK-NEXT:    [[RETVAL:%.*]] = select i1 [[FCMP]], float [[X]], float [[FADD]]
193; CHECK-NEXT:    ret float [[RETVAL]]
194;
195  %fcmp = fcmp une float %y, 0.0
196  %fadd = fadd float %x, %y
197  %retval = select i1 %fcmp, float %x, float %fadd
198  ret float %retval
199}
200
201define <2 x float> @select_fcmp_fadd_oeq_not_zero_vec(<2 x float> %x, <2 x float> %y) {
202; CHECK-LABEL: define <2 x float> @select_fcmp_fadd_oeq_not_zero_vec(
203; CHECK-SAME: <2 x float> [[X:%.*]], <2 x float> [[Y:%.*]]) {
204; CHECK-NEXT:    [[FCMP:%.*]] = fcmp oeq <2 x float> [[Y]], splat (float 2.000000e+00)
205; CHECK-NEXT:    [[FADD:%.*]] = fadd <2 x float> [[X]], splat (float 2.000000e+00)
206; CHECK-NEXT:    [[RETVAL:%.*]] = select <2 x i1> [[FCMP]], <2 x float> [[FADD]], <2 x float> [[X]]
207; CHECK-NEXT:    ret <2 x float> [[RETVAL]]
208;
209  %fcmp = fcmp oeq <2 x float> %y, <float 2.0, float 2.0>
210  %fadd = fadd <2 x float> %x, %y
211  %retval = select <2 x i1> %fcmp, <2 x float> %fadd, <2 x float> %x
212  ret <2 x float> %retval
213}
214
215define <2 x float> @select_fcmp_fadd_une_not_zero_vec(<2 x float> %x, <2 x float> %y) {
216; CHECK-LABEL: define <2 x float> @select_fcmp_fadd_une_not_zero_vec(
217; CHECK-SAME: <2 x float> [[X:%.*]], <2 x float> [[Y:%.*]]) {
218; CHECK-NEXT:    [[FCMP:%.*]] = fcmp une <2 x float> [[Y]], splat (float 2.000000e+00)
219; CHECK-NEXT:    [[FADD:%.*]] = fadd <2 x float> [[X]], splat (float 2.000000e+00)
220; CHECK-NEXT:    [[RETVAL:%.*]] = select <2 x i1> [[FCMP]], <2 x float> [[X]], <2 x float> [[FADD]]
221; CHECK-NEXT:    ret <2 x float> [[RETVAL]]
222;
223  %fcmp = fcmp une <2 x float> %y, <float 2.0, float 2.0>
224  %fadd = fadd <2 x float> %x, %y
225  %retval = select <2 x i1> %fcmp, <2 x float> %x, <2 x float> %fadd
226  ret <2 x float> %retval
227}
228
229define <2 x float> @select_fcmp_fadd_ueq_nnan_not_zero_vec(<2 x float> %x, <2 x float> %y) {
230; CHECK-LABEL: define <2 x float> @select_fcmp_fadd_ueq_nnan_not_zero_vec(
231; CHECK-SAME: <2 x float> [[X:%.*]], <2 x float> [[Y:%.*]]) {
232; CHECK-NEXT:    [[FCMP:%.*]] = fcmp nnan ueq <2 x float> [[Y]], splat (float 2.000000e+00)
233; CHECK-NEXT:    [[FADD:%.*]] = fadd <2 x float> [[X]], splat (float 2.000000e+00)
234; CHECK-NEXT:    [[RETVAL:%.*]] = select <2 x i1> [[FCMP]], <2 x float> [[FADD]], <2 x float> [[X]]
235; CHECK-NEXT:    ret <2 x float> [[RETVAL]]
236;
237  %fcmp = fcmp nnan ueq <2 x float> %y, <float 2.0, float 2.0>
238  %fadd = fadd <2 x float> %x, %y
239  %retval = select <2 x i1> %fcmp, <2 x float> %fadd, <2 x float> %x
240  ret <2 x float> %retval
241}
242
243define <2 x float> @select_fcmp_fadd_one_nnan_not_zero_vec(<2 x float> %x, <2 x float> %y) {
244; CHECK-LABEL: define <2 x float> @select_fcmp_fadd_one_nnan_not_zero_vec(
245; CHECK-SAME: <2 x float> [[X:%.*]], <2 x float> [[Y:%.*]]) {
246; CHECK-NEXT:    [[FCMP:%.*]] = fcmp nnan one <2 x float> [[Y]], splat (float 2.000000e+00)
247; CHECK-NEXT:    [[FADD:%.*]] = fadd <2 x float> [[X]], splat (float 2.000000e+00)
248; CHECK-NEXT:    [[RETVAL:%.*]] = select <2 x i1> [[FCMP]], <2 x float> [[X]], <2 x float> [[FADD]]
249; CHECK-NEXT:    ret <2 x float> [[RETVAL]]
250;
251  %fcmp = fcmp nnan one <2 x float> %y, <float 2.0, float 2.0>
252  %fadd = fadd <2 x float> %x, %y
253  %retval = select <2 x i1> %fcmp, <2 x float> %x, <2 x float> %fadd
254  ret <2 x float> %retval
255}
256
257define <2 x float> @select_fcmp_fadd_ueq_vec(<2 x float> %x, <2 x float> %y) {
258; CHECK-LABEL: define <2 x float> @select_fcmp_fadd_ueq_vec(
259; CHECK-SAME: <2 x float> [[X:%.*]], <2 x float> [[Y:%.*]]) {
260; CHECK-NEXT:    [[FCMP:%.*]] = fcmp ueq <2 x float> [[Y]], splat (float 2.000000e+00)
261; CHECK-NEXT:    [[FADD:%.*]] = fadd <2 x float> [[X]], [[Y]]
262; CHECK-NEXT:    [[RETVAL:%.*]] = select <2 x i1> [[FCMP]], <2 x float> [[FADD]], <2 x float> [[X]]
263; CHECK-NEXT:    ret <2 x float> [[RETVAL]]
264;
265  %fcmp = fcmp ueq <2 x float> %y, <float 2.0, float 2.0>
266  %fadd = fadd <2 x float> %x, %y
267  %retval = select <2 x i1> %fcmp, <2 x float> %fadd, <2 x float> %x
268  ret <2 x float> %retval
269}
270
271define <2 x float> @select_fcmp_fadd_one_vec(<2 x float> %x, <2 x float> %y) {
272; CHECK-LABEL: define <2 x float> @select_fcmp_fadd_one_vec(
273; CHECK-SAME: <2 x float> [[X:%.*]], <2 x float> [[Y:%.*]]) {
274; CHECK-NEXT:    [[FCMP:%.*]] = fcmp one <2 x float> [[Y]], splat (float 2.000000e+00)
275; CHECK-NEXT:    [[FADD:%.*]] = fadd <2 x float> [[X]], [[Y]]
276; CHECK-NEXT:    [[RETVAL:%.*]] = select <2 x i1> [[FCMP]], <2 x float> [[X]], <2 x float> [[FADD]]
277; CHECK-NEXT:    ret <2 x float> [[RETVAL]]
278;
279  %fcmp = fcmp one <2 x float> %y, <float 2.0, float 2.0>
280  %fadd = fadd <2 x float> %x, %y
281  %retval = select <2 x i1> %fcmp, <2 x float> %x, <2 x float> %fadd
282  ret <2 x float> %retval
283}
284
285define <2 x float> @select_fcmp_fadd_oeq_zero_vec(<2 x float> %x, <2 x float> %y) {
286; CHECK-LABEL: define <2 x float> @select_fcmp_fadd_oeq_zero_vec(
287; CHECK-SAME: <2 x float> [[X:%.*]], <2 x float> [[Y:%.*]]) {
288; CHECK-NEXT:    [[FCMP:%.*]] = fcmp oeq <2 x float> [[Y]], zeroinitializer
289; CHECK-NEXT:    [[FADD:%.*]] = fadd <2 x float> [[X]], [[Y]]
290; CHECK-NEXT:    [[RETVAL:%.*]] = select <2 x i1> [[FCMP]], <2 x float> [[FADD]], <2 x float> [[X]]
291; CHECK-NEXT:    ret <2 x float> [[RETVAL]]
292;
293  %fcmp = fcmp oeq <2 x float> %y, zeroinitializer
294  %fadd = fadd <2 x float> %x, %y
295  %retval = select <2 x i1> %fcmp, <2 x float> %fadd, <2 x float> %x
296  ret <2 x float> %retval
297}
298
299define <2 x float> @select_fcmp_fadd_une_zero_vec(<2 x float> %x, <2 x float> %y) {
300; CHECK-LABEL: define <2 x float> @select_fcmp_fadd_une_zero_vec(
301; CHECK-SAME: <2 x float> [[X:%.*]], <2 x float> [[Y:%.*]]) {
302; CHECK-NEXT:    [[FCMP:%.*]] = fcmp une <2 x float> [[Y]], zeroinitializer
303; CHECK-NEXT:    [[FADD:%.*]] = fadd <2 x float> [[X]], [[Y]]
304; CHECK-NEXT:    [[RETVAL:%.*]] = select <2 x i1> [[FCMP]], <2 x float> [[X]], <2 x float> [[FADD]]
305; CHECK-NEXT:    ret <2 x float> [[RETVAL]]
306;
307  %fcmp = fcmp une <2 x float> %y, zeroinitializer
308  %fadd = fadd <2 x float> %x, %y
309  %retval = select <2 x i1> %fcmp, <2 x float> %x, <2 x float> %fadd
310  ret <2 x float> %retval
311}
312
313define <2 x i8> @select_vec_op_const_no_undef(<2 x i8> %x) {
314; CHECK-LABEL: define <2 x i8> @select_vec_op_const_no_undef(
315; CHECK-SAME: <2 x i8> [[X:%.*]]) {
316; CHECK-NEXT:    [[XZ:%.*]] = icmp eq <2 x i8> [[X]], <i8 1, i8 2>
317; CHECK-NEXT:    [[XR:%.*]] = select <2 x i1> [[XZ]], <2 x i8> <i8 1, i8 2>, <2 x i8> <i8 4, i8 3>
318; CHECK-NEXT:    ret <2 x i8> [[XR]]
319;
320  %xz = icmp eq <2 x i8> %x, <i8 1, i8 2>
321  %xr = select <2 x i1> %xz, <2 x i8> %x, <2 x i8> <i8 4, i8 3>
322  ret <2 x i8> %xr
323}
324
325define <2 x i8> @select_vec_op_const_undef(<2 x i8> %x) {
326; CHECK-LABEL: define <2 x i8> @select_vec_op_const_undef(
327; CHECK-SAME: <2 x i8> [[X:%.*]]) {
328; CHECK-NEXT:    [[XZ:%.*]] = icmp eq <2 x i8> [[X]], <i8 1, i8 undef>
329; CHECK-NEXT:    [[XR:%.*]] = select <2 x i1> [[XZ]], <2 x i8> [[X]], <2 x i8> <i8 4, i8 3>
330; CHECK-NEXT:    ret <2 x i8> [[XR]]
331;
332  %xz = icmp eq <2 x i8> %x, <i8 1, i8 undef>
333  %xr = select <2 x i1> %xz, <2 x i8> %x, <2 x i8> <i8 4, i8 3>
334  ret <2 x i8> %xr
335}
336