1; RUN: opt < %s -cost-model -analyze -mtriple=systemz-unknown -mcpu=z13 | FileCheck %s
2;
3; TODO: add more tests for differing operand types of the two compares.
4
5define i8 @fun0(i8 %val1, i8 %val2, i8 %val3, i8 %val4,
6                i8 %val5, i8 %val6) {
7  %cmp0 = icmp eq i8 %val1, %val2
8  %cmp1 = icmp eq i8 %val3, %val4
9  %and = and i1 %cmp0, %cmp1
10  %sel = select i1 %and, i8 %val5, i8 %val6
11  ret i8 %sel
12
13; CHECK: fun0
14; CHECK: cost of 3 for instruction:   %cmp0 = icmp eq i8 %val1, %val2
15; CHECK: cost of 3 for instruction:   %cmp1 = icmp eq i8 %val3, %val4
16; CHECK: cost of 1 for instruction:   %and = and i1 %cmp0, %cmp1
17; CHECK: cost of 1 for instruction:   %sel = select i1 %and, i8 %val5, i8 %val6
18}
19
20define i16 @fun1(i8 %val1, i8 %val2, i8 %val3, i8 %val4,
21                 i16 %val5, i16 %val6) {
22  %cmp0 = icmp eq i8 %val1, %val2
23  %cmp1 = icmp eq i8 %val3, %val4
24  %and = and i1 %cmp0, %cmp1
25  %sel = select i1 %and, i16 %val5, i16 %val6
26  ret i16 %sel
27
28; CHECK: fun1
29; CHECK: cost of 3 for instruction:   %cmp0 = icmp eq i8 %val1, %val2
30; CHECK: cost of 3 for instruction:   %cmp1 = icmp eq i8 %val3, %val4
31; CHECK: cost of 1 for instruction:   %and = and i1 %cmp0, %cmp1
32; CHECK: cost of 1 for instruction:   %sel = select i1 %and, i16 %val5, i16 %val6
33}
34
35define i32 @fun2(i8 %val1, i8 %val2, i8 %val3, i8 %val4,
36                 i32 %val5, i32 %val6) {
37  %cmp0 = icmp eq i8 %val1, %val2
38  %cmp1 = icmp eq i8 %val3, %val4
39  %and = and i1 %cmp0, %cmp1
40  %sel = select i1 %and, i32 %val5, i32 %val6
41  ret i32 %sel
42
43; CHECK: fun2
44; CHECK: cost of 3 for instruction:   %cmp0 = icmp eq i8 %val1, %val2
45; CHECK: cost of 3 for instruction:   %cmp1 = icmp eq i8 %val3, %val4
46; CHECK: cost of 1 for instruction:   %and = and i1 %cmp0, %cmp1
47; CHECK: cost of 1 for instruction:   %sel = select i1 %and, i32 %val5, i32 %val6
48}
49
50define i64 @fun3(i8 %val1, i8 %val2, i8 %val3, i8 %val4,
51                 i64 %val5, i64 %val6) {
52  %cmp0 = icmp eq i8 %val1, %val2
53  %cmp1 = icmp eq i8 %val3, %val4
54  %and = and i1 %cmp0, %cmp1
55  %sel = select i1 %and, i64 %val5, i64 %val6
56  ret i64 %sel
57
58; CHECK: fun3
59; CHECK: cost of 3 for instruction:   %cmp0 = icmp eq i8 %val1, %val2
60; CHECK: cost of 3 for instruction:   %cmp1 = icmp eq i8 %val3, %val4
61; CHECK: cost of 1 for instruction:   %and = and i1 %cmp0, %cmp1
62; CHECK: cost of 1 for instruction:   %sel = select i1 %and, i64 %val5, i64 %val6
63}
64
65define float @fun4(i8 %val1, i8 %val2, i8 %val3, i8 %val4,
66                   float %val5, float %val6) {
67  %cmp0 = icmp eq i8 %val1, %val2
68  %cmp1 = icmp eq i8 %val3, %val4
69  %and = and i1 %cmp0, %cmp1
70  %sel = select i1 %and, float %val5, float %val6
71  ret float %sel
72
73; CHECK: fun4
74; CHECK: cost of 3 for instruction:   %cmp0 = icmp eq i8 %val1, %val2
75; CHECK: cost of 3 for instruction:   %cmp1 = icmp eq i8 %val3, %val4
76; CHECK: cost of 1 for instruction:   %and = and i1 %cmp0, %cmp1
77; CHECK: cost of 4 for instruction:   %sel = select i1 %and, float %val5, float %val6
78}
79
80define double @fun5(i8 %val1, i8 %val2, i8 %val3, i8 %val4,
81                    double %val5, double %val6) {
82  %cmp0 = icmp eq i8 %val1, %val2
83  %cmp1 = icmp eq i8 %val3, %val4
84  %and = and i1 %cmp0, %cmp1
85  %sel = select i1 %and, double %val5, double %val6
86  ret double %sel
87
88; CHECK: fun5
89; CHECK: cost of 3 for instruction:   %cmp0 = icmp eq i8 %val1, %val2
90; CHECK: cost of 3 for instruction:   %cmp1 = icmp eq i8 %val3, %val4
91; CHECK: cost of 1 for instruction:   %and = and i1 %cmp0, %cmp1
92; CHECK: cost of 4 for instruction:   %sel = select i1 %and, double %val5, double %val6
93}
94
95define i8 @fun6(i16 %val1, i16 %val2, i16 %val3, i16 %val4,
96                i8 %val5, i8 %val6) {
97  %cmp0 = icmp eq i16 %val1, %val2
98  %cmp1 = icmp eq i16 %val3, %val4
99  %and = and i1 %cmp0, %cmp1
100  %sel = select i1 %and, i8 %val5, i8 %val6
101  ret i8 %sel
102
103; CHECK: fun6
104; CHECK: cost of 3 for instruction:   %cmp0 = icmp eq i16 %val1, %val2
105; CHECK: cost of 3 for instruction:   %cmp1 = icmp eq i16 %val3, %val4
106; CHECK: cost of 1 for instruction:   %and = and i1 %cmp0, %cmp1
107; CHECK: cost of 1 for instruction:   %sel = select i1 %and, i8 %val5, i8 %val6
108}
109
110define i16 @fun7(i16 %val1, i16 %val2, i16 %val3, i16 %val4,
111                 i16 %val5, i16 %val6) {
112  %cmp0 = icmp eq i16 %val1, %val2
113  %cmp1 = icmp eq i16 %val3, %val4
114  %and = and i1 %cmp0, %cmp1
115  %sel = select i1 %and, i16 %val5, i16 %val6
116  ret i16 %sel
117
118; CHECK: fun7
119; CHECK: cost of 3 for instruction:   %cmp0 = icmp eq i16 %val1, %val2
120; CHECK: cost of 3 for instruction:   %cmp1 = icmp eq i16 %val3, %val4
121; CHECK: cost of 1 for instruction:   %and = and i1 %cmp0, %cmp1
122; CHECK: cost of 1 for instruction:   %sel = select i1 %and, i16 %val5, i16 %val6
123}
124
125define i32 @fun8(i16 %val1, i16 %val2, i16 %val3, i16 %val4,
126                 i32 %val5, i32 %val6) {
127  %cmp0 = icmp eq i16 %val1, %val2
128  %cmp1 = icmp eq i16 %val3, %val4
129  %and = and i1 %cmp0, %cmp1
130  %sel = select i1 %and, i32 %val5, i32 %val6
131  ret i32 %sel
132
133; CHECK: fun8
134; CHECK: cost of 3 for instruction:   %cmp0 = icmp eq i16 %val1, %val2
135; CHECK: cost of 3 for instruction:   %cmp1 = icmp eq i16 %val3, %val4
136; CHECK: cost of 1 for instruction:   %and = and i1 %cmp0, %cmp1
137; CHECK: cost of 1 for instruction:   %sel = select i1 %and, i32 %val5, i32 %val6
138}
139
140define i64 @fun9(i16 %val1, i16 %val2, i16 %val3, i16 %val4,
141                 i64 %val5, i64 %val6) {
142  %cmp0 = icmp eq i16 %val1, %val2
143  %cmp1 = icmp eq i16 %val3, %val4
144  %and = and i1 %cmp0, %cmp1
145  %sel = select i1 %and, i64 %val5, i64 %val6
146  ret i64 %sel
147
148; CHECK: fun9
149; CHECK: cost of 3 for instruction:   %cmp0 = icmp eq i16 %val1, %val2
150; CHECK: cost of 3 for instruction:   %cmp1 = icmp eq i16 %val3, %val4
151; CHECK: cost of 1 for instruction:   %and = and i1 %cmp0, %cmp1
152; CHECK: cost of 1 for instruction:   %sel = select i1 %and, i64 %val5, i64 %val6
153}
154
155define float @fun10(i16 %val1, i16 %val2, i16 %val3, i16 %val4,
156                    float %val5, float %val6) {
157  %cmp0 = icmp eq i16 %val1, %val2
158  %cmp1 = icmp eq i16 %val3, %val4
159  %and = and i1 %cmp0, %cmp1
160  %sel = select i1 %and, float %val5, float %val6
161  ret float %sel
162
163; CHECK: fun10
164; CHECK: cost of 3 for instruction:   %cmp0 = icmp eq i16 %val1, %val2
165; CHECK: cost of 3 for instruction:   %cmp1 = icmp eq i16 %val3, %val4
166; CHECK: cost of 1 for instruction:   %and = and i1 %cmp0, %cmp1
167; CHECK: cost of 4 for instruction:   %sel = select i1 %and, float %val5, float %val6
168}
169
170define double @fun11(i16 %val1, i16 %val2, i16 %val3, i16 %val4,
171                     double %val5, double %val6) {
172  %cmp0 = icmp eq i16 %val1, %val2
173  %cmp1 = icmp eq i16 %val3, %val4
174  %and = and i1 %cmp0, %cmp1
175  %sel = select i1 %and, double %val5, double %val6
176  ret double %sel
177
178; CHECK: fun11
179; CHECK: cost of 3 for instruction:   %cmp0 = icmp eq i16 %val1, %val2
180; CHECK: cost of 3 for instruction:   %cmp1 = icmp eq i16 %val3, %val4
181; CHECK: cost of 1 for instruction:   %and = and i1 %cmp0, %cmp1
182; CHECK: cost of 4 for instruction:   %sel = select i1 %and, double %val5, double %val6
183}
184
185define i8 @fun12(i32 %val1, i32 %val2, i32 %val3, i32 %val4,
186                 i8 %val5, i8 %val6) {
187  %cmp0 = icmp eq i32 %val1, %val2
188  %cmp1 = icmp eq i32 %val3, %val4
189  %and = and i1 %cmp0, %cmp1
190  %sel = select i1 %and, i8 %val5, i8 %val6
191  ret i8 %sel
192
193; CHECK: fun12
194; CHECK: cost of 1 for instruction:   %cmp0 = icmp eq i32 %val1, %val2
195; CHECK: cost of 1 for instruction:   %cmp1 = icmp eq i32 %val3, %val4
196; CHECK: cost of 1 for instruction:   %and = and i1 %cmp0, %cmp1
197; CHECK: cost of 1 for instruction:   %sel = select i1 %and, i8 %val5, i8 %val6
198}
199
200define i16 @fun13(i32 %val1, i32 %val2, i32 %val3, i32 %val4,
201                  i16 %val5, i16 %val6) {
202  %cmp0 = icmp eq i32 %val1, %val2
203  %cmp1 = icmp eq i32 %val3, %val4
204  %and = and i1 %cmp0, %cmp1
205  %sel = select i1 %and, i16 %val5, i16 %val6
206  ret i16 %sel
207
208; CHECK: fun13
209; CHECK: cost of 1 for instruction:   %cmp0 = icmp eq i32 %val1, %val2
210; CHECK: cost of 1 for instruction:   %cmp1 = icmp eq i32 %val3, %val4
211; CHECK: cost of 1 for instruction:   %and = and i1 %cmp0, %cmp1
212; CHECK: cost of 1 for instruction:   %sel = select i1 %and, i16 %val5, i16 %val6
213}
214
215define i32 @fun14(i32 %val1, i32 %val2, i32 %val3, i32 %val4,
216                  i32 %val5, i32 %val6) {
217  %cmp0 = icmp eq i32 %val1, %val2
218  %cmp1 = icmp eq i32 %val3, %val4
219  %and = and i1 %cmp0, %cmp1
220  %sel = select i1 %and, i32 %val5, i32 %val6
221  ret i32 %sel
222
223; CHECK: fun14
224; CHECK: cost of 1 for instruction:   %cmp0 = icmp eq i32 %val1, %val2
225; CHECK: cost of 1 for instruction:   %cmp1 = icmp eq i32 %val3, %val4
226; CHECK: cost of 1 for instruction:   %and = and i1 %cmp0, %cmp1
227; CHECK: cost of 1 for instruction:   %sel = select i1 %and, i32 %val5, i32 %val6
228}
229
230define i64 @fun15(i32 %val1, i32 %val2, i32 %val3, i32 %val4,
231                  i64 %val5, i64 %val6) {
232  %cmp0 = icmp eq i32 %val1, %val2
233  %cmp1 = icmp eq i32 %val3, %val4
234  %and = and i1 %cmp0, %cmp1
235  %sel = select i1 %and, i64 %val5, i64 %val6
236  ret i64 %sel
237
238; CHECK: fun15
239; CHECK: cost of 1 for instruction:   %cmp0 = icmp eq i32 %val1, %val2
240; CHECK: cost of 1 for instruction:   %cmp1 = icmp eq i32 %val3, %val4
241; CHECK: cost of 1 for instruction:   %and = and i1 %cmp0, %cmp1
242; CHECK: cost of 1 for instruction:   %sel = select i1 %and, i64 %val5, i64 %val6
243}
244
245define float @fun16(i32 %val1, i32 %val2, i32 %val3, i32 %val4,
246                    float %val5, float %val6) {
247  %cmp0 = icmp eq i32 %val1, %val2
248  %cmp1 = icmp eq i32 %val3, %val4
249  %and = and i1 %cmp0, %cmp1
250  %sel = select i1 %and, float %val5, float %val6
251  ret float %sel
252
253; CHECK: fun16
254; CHECK: cost of 1 for instruction:   %cmp0 = icmp eq i32 %val1, %val2
255; CHECK: cost of 1 for instruction:   %cmp1 = icmp eq i32 %val3, %val4
256; CHECK: cost of 1 for instruction:   %and = and i1 %cmp0, %cmp1
257; CHECK: cost of 4 for instruction:   %sel = select i1 %and, float %val5, float %val6
258}
259
260define double @fun17(i32 %val1, i32 %val2, i32 %val3, i32 %val4,
261                     double %val5, double %val6) {
262  %cmp0 = icmp eq i32 %val1, %val2
263  %cmp1 = icmp eq i32 %val3, %val4
264  %and = and i1 %cmp0, %cmp1
265  %sel = select i1 %and, double %val5, double %val6
266  ret double %sel
267
268; CHECK: fun17
269; CHECK: cost of 1 for instruction:   %cmp0 = icmp eq i32 %val1, %val2
270; CHECK: cost of 1 for instruction:   %cmp1 = icmp eq i32 %val3, %val4
271; CHECK: cost of 1 for instruction:   %and = and i1 %cmp0, %cmp1
272; CHECK: cost of 4 for instruction:   %sel = select i1 %and, double %val5, double %val6
273}
274
275define i8 @fun18(i64 %val1, i64 %val2, i64 %val3, i64 %val4,
276                 i8 %val5, i8 %val6) {
277  %cmp0 = icmp eq i64 %val1, %val2
278  %cmp1 = icmp eq i64 %val3, %val4
279  %and = and i1 %cmp0, %cmp1
280  %sel = select i1 %and, i8 %val5, i8 %val6
281  ret i8 %sel
282
283; CHECK: fun18
284; CHECK: cost of 1 for instruction:   %cmp0 = icmp eq i64 %val1, %val2
285; CHECK: cost of 1 for instruction:   %cmp1 = icmp eq i64 %val3, %val4
286; CHECK: cost of 1 for instruction:   %and = and i1 %cmp0, %cmp1
287; CHECK: cost of 1 for instruction:   %sel = select i1 %and, i8 %val5, i8 %val6
288}
289
290define i16 @fun19(i64 %val1, i64 %val2, i64 %val3, i64 %val4,
291                  i16 %val5, i16 %val6) {
292  %cmp0 = icmp eq i64 %val1, %val2
293  %cmp1 = icmp eq i64 %val3, %val4
294  %and = and i1 %cmp0, %cmp1
295  %sel = select i1 %and, i16 %val5, i16 %val6
296  ret i16 %sel
297
298; CHECK: fun19
299; CHECK: cost of 1 for instruction:   %cmp0 = icmp eq i64 %val1, %val2
300; CHECK: cost of 1 for instruction:   %cmp1 = icmp eq i64 %val3, %val4
301; CHECK: cost of 1 for instruction:   %and = and i1 %cmp0, %cmp1
302; CHECK: cost of 1 for instruction:   %sel = select i1 %and, i16 %val5, i16 %val6
303}
304
305define i32 @fun20(i64 %val1, i64 %val2, i64 %val3, i64 %val4,
306                  i32 %val5, i32 %val6) {
307  %cmp0 = icmp eq i64 %val1, %val2
308  %cmp1 = icmp eq i64 %val3, %val4
309  %and = and i1 %cmp0, %cmp1
310  %sel = select i1 %and, i32 %val5, i32 %val6
311  ret i32 %sel
312
313; CHECK: fun20
314; CHECK: cost of 1 for instruction:   %cmp0 = icmp eq i64 %val1, %val2
315; CHECK: cost of 1 for instruction:   %cmp1 = icmp eq i64 %val3, %val4
316; CHECK: cost of 1 for instruction:   %and = and i1 %cmp0, %cmp1
317; CHECK: cost of 1 for instruction:   %sel = select i1 %and, i32 %val5, i32 %val6
318}
319
320define i64 @fun21(i64 %val1, i64 %val2, i64 %val3, i64 %val4,
321                  i64 %val5, i64 %val6) {
322  %cmp0 = icmp eq i64 %val1, %val2
323  %cmp1 = icmp eq i64 %val3, %val4
324  %and = and i1 %cmp0, %cmp1
325  %sel = select i1 %and, i64 %val5, i64 %val6
326  ret i64 %sel
327
328; CHECK: fun21
329; CHECK: cost of 1 for instruction:   %cmp0 = icmp eq i64 %val1, %val2
330; CHECK: cost of 1 for instruction:   %cmp1 = icmp eq i64 %val3, %val4
331; CHECK: cost of 1 for instruction:   %and = and i1 %cmp0, %cmp1
332; CHECK: cost of 1 for instruction:   %sel = select i1 %and, i64 %val5, i64 %val6
333}
334
335define float @fun22(i64 %val1, i64 %val2, i64 %val3, i64 %val4,
336                    float %val5, float %val6) {
337  %cmp0 = icmp eq i64 %val1, %val2
338  %cmp1 = icmp eq i64 %val3, %val4
339  %and = and i1 %cmp0, %cmp1
340  %sel = select i1 %and, float %val5, float %val6
341  ret float %sel
342
343; CHECK: fun22
344; CHECK: cost of 1 for instruction:   %cmp0 = icmp eq i64 %val1, %val2
345; CHECK: cost of 1 for instruction:   %cmp1 = icmp eq i64 %val3, %val4
346; CHECK: cost of 1 for instruction:   %and = and i1 %cmp0, %cmp1
347; CHECK: cost of 4 for instruction:   %sel = select i1 %and, float %val5, float %val6
348}
349
350define double @fun23(i64 %val1, i64 %val2, i64 %val3, i64 %val4,
351                     double %val5, double %val6) {
352  %cmp0 = icmp eq i64 %val1, %val2
353  %cmp1 = icmp eq i64 %val3, %val4
354  %and = and i1 %cmp0, %cmp1
355  %sel = select i1 %and, double %val5, double %val6
356  ret double %sel
357
358; CHECK: fun23
359; CHECK: cost of 1 for instruction:   %cmp0 = icmp eq i64 %val1, %val2
360; CHECK: cost of 1 for instruction:   %cmp1 = icmp eq i64 %val3, %val4
361; CHECK: cost of 1 for instruction:   %and = and i1 %cmp0, %cmp1
362; CHECK: cost of 4 for instruction:   %sel = select i1 %and, double %val5, double %val6
363}
364
365define i8 @fun24(float %val1, float %val2, float %val3, float %val4,
366                 i8 %val5, i8 %val6) {
367  %cmp0 = fcmp ogt float %val1, %val2
368  %cmp1 = fcmp ogt float %val3, %val4
369  %and = and i1 %cmp0, %cmp1
370  %sel = select i1 %and, i8 %val5, i8 %val6
371  ret i8 %sel
372
373; CHECK: fun24
374; CHECK: cost of 1 for instruction:   %cmp0 = fcmp ogt float %val1, %val2
375; CHECK: cost of 1 for instruction:   %cmp1 = fcmp ogt float %val3, %val4
376; CHECK: cost of 1 for instruction:   %and = and i1 %cmp0, %cmp1
377; CHECK: cost of 1 for instruction:   %sel = select i1 %and, i8 %val5, i8 %val6
378}
379
380define i16 @fun25(float %val1, float %val2, float %val3, float %val4,
381                  i16 %val5, i16 %val6) {
382  %cmp0 = fcmp ogt float %val1, %val2
383  %cmp1 = fcmp ogt float %val3, %val4
384  %and = and i1 %cmp0, %cmp1
385  %sel = select i1 %and, i16 %val5, i16 %val6
386  ret i16 %sel
387
388; CHECK: fun25
389; CHECK: cost of 1 for instruction:   %cmp0 = fcmp ogt float %val1, %val2
390; CHECK: cost of 1 for instruction:   %cmp1 = fcmp ogt float %val3, %val4
391; CHECK: cost of 1 for instruction:   %and = and i1 %cmp0, %cmp1
392; CHECK: cost of 1 for instruction:   %sel = select i1 %and, i16 %val5, i16 %val6
393}
394
395define i32 @fun26(float %val1, float %val2, float %val3, float %val4,
396                  i32 %val5, i32 %val6) {
397  %cmp0 = fcmp ogt float %val1, %val2
398  %cmp1 = fcmp ogt float %val3, %val4
399  %and = and i1 %cmp0, %cmp1
400  %sel = select i1 %and, i32 %val5, i32 %val6
401  ret i32 %sel
402
403; CHECK: fun26
404; CHECK: cost of 1 for instruction:   %cmp0 = fcmp ogt float %val1, %val2
405; CHECK: cost of 1 for instruction:   %cmp1 = fcmp ogt float %val3, %val4
406; CHECK: cost of 1 for instruction:   %and = and i1 %cmp0, %cmp1
407; CHECK: cost of 1 for instruction:   %sel = select i1 %and, i32 %val5, i32 %val6
408}
409
410define i64 @fun27(float %val1, float %val2, float %val3, float %val4,
411                  i64 %val5, i64 %val6) {
412  %cmp0 = fcmp ogt float %val1, %val2
413  %cmp1 = fcmp ogt float %val3, %val4
414  %and = and i1 %cmp0, %cmp1
415  %sel = select i1 %and, i64 %val5, i64 %val6
416  ret i64 %sel
417
418; CHECK: fun27
419; CHECK: cost of 1 for instruction:   %cmp0 = fcmp ogt float %val1, %val2
420; CHECK: cost of 1 for instruction:   %cmp1 = fcmp ogt float %val3, %val4
421; CHECK: cost of 1 for instruction:   %and = and i1 %cmp0, %cmp1
422; CHECK: cost of 1 for instruction:   %sel = select i1 %and, i64 %val5, i64 %val6
423}
424
425define float @fun28(float %val1, float %val2, float %val3, float %val4,
426                    float %val5, float %val6) {
427  %cmp0 = fcmp ogt float %val1, %val2
428  %cmp1 = fcmp ogt float %val3, %val4
429  %and = and i1 %cmp0, %cmp1
430  %sel = select i1 %and, float %val5, float %val6
431  ret float %sel
432
433; CHECK: fun28
434; CHECK: cost of 1 for instruction:   %cmp0 = fcmp ogt float %val1, %val2
435; CHECK: cost of 1 for instruction:   %cmp1 = fcmp ogt float %val3, %val4
436; CHECK: cost of 1 for instruction:   %and = and i1 %cmp0, %cmp1
437; CHECK: cost of 4 for instruction:   %sel = select i1 %and, float %val5, float %val6
438}
439
440define double @fun29(float %val1, float %val2, float %val3, float %val4,
441                     double %val5, double %val6) {
442  %cmp0 = fcmp ogt float %val1, %val2
443  %cmp1 = fcmp ogt float %val3, %val4
444  %and = and i1 %cmp0, %cmp1
445  %sel = select i1 %and, double %val5, double %val6
446  ret double %sel
447
448; CHECK: fun29
449; CHECK: cost of 1 for instruction:   %cmp0 = fcmp ogt float %val1, %val2
450; CHECK: cost of 1 for instruction:   %cmp1 = fcmp ogt float %val3, %val4
451; CHECK: cost of 1 for instruction:   %and = and i1 %cmp0, %cmp1
452; CHECK: cost of 4 for instruction:   %sel = select i1 %and, double %val5, double %val6
453}
454
455define i8 @fun30(double %val1, double %val2, double %val3, double %val4,
456                 i8 %val5, i8 %val6) {
457  %cmp0 = fcmp ogt double %val1, %val2
458  %cmp1 = fcmp ogt double %val3, %val4
459  %and = and i1 %cmp0, %cmp1
460  %sel = select i1 %and, i8 %val5, i8 %val6
461  ret i8 %sel
462
463; CHECK: fun30
464; CHECK: cost of 1 for instruction:   %cmp0 = fcmp ogt double %val1, %val2
465; CHECK: cost of 1 for instruction:   %cmp1 = fcmp ogt double %val3, %val4
466; CHECK: cost of 1 for instruction:   %and = and i1 %cmp0, %cmp1
467; CHECK: cost of 1 for instruction:   %sel = select i1 %and, i8 %val5, i8 %val6
468}
469
470define i16 @fun31(double %val1, double %val2, double %val3, double %val4,
471                  i16 %val5, i16 %val6) {
472  %cmp0 = fcmp ogt double %val1, %val2
473  %cmp1 = fcmp ogt double %val3, %val4
474  %and = and i1 %cmp0, %cmp1
475  %sel = select i1 %and, i16 %val5, i16 %val6
476  ret i16 %sel
477
478; CHECK: fun31
479; CHECK: cost of 1 for instruction:   %cmp0 = fcmp ogt double %val1, %val2
480; CHECK: cost of 1 for instruction:   %cmp1 = fcmp ogt double %val3, %val4
481; CHECK: cost of 1 for instruction:   %and = and i1 %cmp0, %cmp1
482; CHECK: cost of 1 for instruction:   %sel = select i1 %and, i16 %val5, i16 %val6
483}
484
485define i32 @fun32(double %val1, double %val2, double %val3, double %val4,
486                  i32 %val5, i32 %val6) {
487  %cmp0 = fcmp ogt double %val1, %val2
488  %cmp1 = fcmp ogt double %val3, %val4
489  %and = and i1 %cmp0, %cmp1
490  %sel = select i1 %and, i32 %val5, i32 %val6
491  ret i32 %sel
492
493; CHECK: fun32
494; CHECK: cost of 1 for instruction:   %cmp0 = fcmp ogt double %val1, %val2
495; CHECK: cost of 1 for instruction:   %cmp1 = fcmp ogt double %val3, %val4
496; CHECK: cost of 1 for instruction:   %and = and i1 %cmp0, %cmp1
497; CHECK: cost of 1 for instruction:   %sel = select i1 %and, i32 %val5, i32 %val6
498}
499
500define i64 @fun33(double %val1, double %val2, double %val3, double %val4,
501                  i64 %val5, i64 %val6) {
502  %cmp0 = fcmp ogt double %val1, %val2
503  %cmp1 = fcmp ogt double %val3, %val4
504  %and = and i1 %cmp0, %cmp1
505  %sel = select i1 %and, i64 %val5, i64 %val6
506  ret i64 %sel
507
508; CHECK: fun33
509; CHECK: cost of 1 for instruction:   %cmp0 = fcmp ogt double %val1, %val2
510; CHECK: cost of 1 for instruction:   %cmp1 = fcmp ogt double %val3, %val4
511; CHECK: cost of 1 for instruction:   %and = and i1 %cmp0, %cmp1
512; CHECK: cost of 1 for instruction:   %sel = select i1 %and, i64 %val5, i64 %val6
513}
514
515define float @fun34(double %val1, double %val2, double %val3, double %val4,
516                    float %val5, float %val6) {
517  %cmp0 = fcmp ogt double %val1, %val2
518  %cmp1 = fcmp ogt double %val3, %val4
519  %and = and i1 %cmp0, %cmp1
520  %sel = select i1 %and, float %val5, float %val6
521  ret float %sel
522
523; CHECK: fun34
524; CHECK: cost of 1 for instruction:   %cmp0 = fcmp ogt double %val1, %val2
525; CHECK: cost of 1 for instruction:   %cmp1 = fcmp ogt double %val3, %val4
526; CHECK: cost of 1 for instruction:   %and = and i1 %cmp0, %cmp1
527; CHECK: cost of 4 for instruction:   %sel = select i1 %and, float %val5, float %val6
528}
529
530define double @fun35(double %val1, double %val2, double %val3, double %val4,
531                     double %val5, double %val6) {
532  %cmp0 = fcmp ogt double %val1, %val2
533  %cmp1 = fcmp ogt double %val3, %val4
534  %and = and i1 %cmp0, %cmp1
535  %sel = select i1 %and, double %val5, double %val6
536  ret double %sel
537
538; CHECK: fun35
539; CHECK: cost of 1 for instruction:   %cmp0 = fcmp ogt double %val1, %val2
540; CHECK: cost of 1 for instruction:   %cmp1 = fcmp ogt double %val3, %val4
541; CHECK: cost of 1 for instruction:   %and = and i1 %cmp0, %cmp1
542; CHECK: cost of 4 for instruction:   %sel = select i1 %and, double %val5, double %val6
543}
544
545define i8 @fun36(i8 %val1, i8 %val2, i8 %val3, i8 %val4,
546                 i8 %val5, i8 %val6) {
547  %cmp0 = icmp eq i8 %val1, %val2
548  %cmp1 = icmp eq i8 %val3, %val4
549  %and = or i1 %cmp0, %cmp1
550  %sel = select i1 %and, i8 %val5, i8 %val6
551  ret i8 %sel
552
553; CHECK: fun36
554; CHECK: cost of 3 for instruction:   %cmp0 = icmp eq i8 %val1, %val2
555; CHECK: cost of 3 for instruction:   %cmp1 = icmp eq i8 %val3, %val4
556; CHECK: cost of 1 for instruction:   %and = or i1 %cmp0, %cmp1
557; CHECK: cost of 1 for instruction:   %sel = select i1 %and, i8 %val5, i8 %val6
558}
559
560define i16 @fun37(i8 %val1, i8 %val2, i8 %val3, i8 %val4,
561                  i16 %val5, i16 %val6) {
562  %cmp0 = icmp eq i8 %val1, %val2
563  %cmp1 = icmp eq i8 %val3, %val4
564  %and = or i1 %cmp0, %cmp1
565  %sel = select i1 %and, i16 %val5, i16 %val6
566  ret i16 %sel
567
568; CHECK: fun37
569; CHECK: cost of 3 for instruction:   %cmp0 = icmp eq i8 %val1, %val2
570; CHECK: cost of 3 for instruction:   %cmp1 = icmp eq i8 %val3, %val4
571; CHECK: cost of 1 for instruction:   %and = or i1 %cmp0, %cmp1
572; CHECK: cost of 1 for instruction:   %sel = select i1 %and, i16 %val5, i16 %val6
573}
574
575define i32 @fun38(i8 %val1, i8 %val2, i8 %val3, i8 %val4,
576                  i32 %val5, i32 %val6) {
577  %cmp0 = icmp eq i8 %val1, %val2
578  %cmp1 = icmp eq i8 %val3, %val4
579  %and = or i1 %cmp0, %cmp1
580  %sel = select i1 %and, i32 %val5, i32 %val6
581  ret i32 %sel
582
583; CHECK: fun38
584; CHECK: cost of 3 for instruction:   %cmp0 = icmp eq i8 %val1, %val2
585; CHECK: cost of 3 for instruction:   %cmp1 = icmp eq i8 %val3, %val4
586; CHECK: cost of 1 for instruction:   %and = or i1 %cmp0, %cmp1
587; CHECK: cost of 1 for instruction:   %sel = select i1 %and, i32 %val5, i32 %val6
588}
589
590define i64 @fun39(i8 %val1, i8 %val2, i8 %val3, i8 %val4,
591                  i64 %val5, i64 %val6) {
592  %cmp0 = icmp eq i8 %val1, %val2
593  %cmp1 = icmp eq i8 %val3, %val4
594  %and = or i1 %cmp0, %cmp1
595  %sel = select i1 %and, i64 %val5, i64 %val6
596  ret i64 %sel
597
598; CHECK: fun39
599; CHECK: cost of 3 for instruction:   %cmp0 = icmp eq i8 %val1, %val2
600; CHECK: cost of 3 for instruction:   %cmp1 = icmp eq i8 %val3, %val4
601; CHECK: cost of 1 for instruction:   %and = or i1 %cmp0, %cmp1
602; CHECK: cost of 1 for instruction:   %sel = select i1 %and, i64 %val5, i64 %val6
603}
604
605define float @fun40(i8 %val1, i8 %val2, i8 %val3, i8 %val4,
606                    float %val5, float %val6) {
607  %cmp0 = icmp eq i8 %val1, %val2
608  %cmp1 = icmp eq i8 %val3, %val4
609  %and = or i1 %cmp0, %cmp1
610  %sel = select i1 %and, float %val5, float %val6
611  ret float %sel
612
613; CHECK: fun40
614; CHECK: cost of 3 for instruction:   %cmp0 = icmp eq i8 %val1, %val2
615; CHECK: cost of 3 for instruction:   %cmp1 = icmp eq i8 %val3, %val4
616; CHECK: cost of 1 for instruction:   %and = or i1 %cmp0, %cmp1
617; CHECK: cost of 4 for instruction:   %sel = select i1 %and, float %val5, float %val6
618}
619
620define double @fun41(i8 %val1, i8 %val2, i8 %val3, i8 %val4,
621                     double %val5, double %val6) {
622  %cmp0 = icmp eq i8 %val1, %val2
623  %cmp1 = icmp eq i8 %val3, %val4
624  %and = or i1 %cmp0, %cmp1
625  %sel = select i1 %and, double %val5, double %val6
626  ret double %sel
627
628; CHECK: fun41
629; CHECK: cost of 3 for instruction:   %cmp0 = icmp eq i8 %val1, %val2
630; CHECK: cost of 3 for instruction:   %cmp1 = icmp eq i8 %val3, %val4
631; CHECK: cost of 1 for instruction:   %and = or i1 %cmp0, %cmp1
632; CHECK: cost of 4 for instruction:   %sel = select i1 %and, double %val5, double %val6
633}
634
635define i8 @fun42(i16 %val1, i16 %val2, i16 %val3, i16 %val4,
636                 i8 %val5, i8 %val6) {
637  %cmp0 = icmp eq i16 %val1, %val2
638  %cmp1 = icmp eq i16 %val3, %val4
639  %and = or i1 %cmp0, %cmp1
640  %sel = select i1 %and, i8 %val5, i8 %val6
641  ret i8 %sel
642
643; CHECK: fun42
644; CHECK: cost of 3 for instruction:   %cmp0 = icmp eq i16 %val1, %val2
645; CHECK: cost of 3 for instruction:   %cmp1 = icmp eq i16 %val3, %val4
646; CHECK: cost of 1 for instruction:   %and = or i1 %cmp0, %cmp1
647; CHECK: cost of 1 for instruction:   %sel = select i1 %and, i8 %val5, i8 %val6
648}
649
650define i16 @fun43(i16 %val1, i16 %val2, i16 %val3, i16 %val4,
651                  i16 %val5, i16 %val6) {
652  %cmp0 = icmp eq i16 %val1, %val2
653  %cmp1 = icmp eq i16 %val3, %val4
654  %and = or i1 %cmp0, %cmp1
655  %sel = select i1 %and, i16 %val5, i16 %val6
656  ret i16 %sel
657
658; CHECK: fun43
659; CHECK: cost of 3 for instruction:   %cmp0 = icmp eq i16 %val1, %val2
660; CHECK: cost of 3 for instruction:   %cmp1 = icmp eq i16 %val3, %val4
661; CHECK: cost of 1 for instruction:   %and = or i1 %cmp0, %cmp1
662; CHECK: cost of 1 for instruction:   %sel = select i1 %and, i16 %val5, i16 %val6
663}
664
665define i32 @fun44(i16 %val1, i16 %val2, i16 %val3, i16 %val4,
666                  i32 %val5, i32 %val6) {
667  %cmp0 = icmp eq i16 %val1, %val2
668  %cmp1 = icmp eq i16 %val3, %val4
669  %and = or i1 %cmp0, %cmp1
670  %sel = select i1 %and, i32 %val5, i32 %val6
671  ret i32 %sel
672
673; CHECK: fun44
674; CHECK: cost of 3 for instruction:   %cmp0 = icmp eq i16 %val1, %val2
675; CHECK: cost of 3 for instruction:   %cmp1 = icmp eq i16 %val3, %val4
676; CHECK: cost of 1 for instruction:   %and = or i1 %cmp0, %cmp1
677; CHECK: cost of 1 for instruction:   %sel = select i1 %and, i32 %val5, i32 %val6
678}
679
680define i64 @fun45(i16 %val1, i16 %val2, i16 %val3, i16 %val4,
681                  i64 %val5, i64 %val6) {
682  %cmp0 = icmp eq i16 %val1, %val2
683  %cmp1 = icmp eq i16 %val3, %val4
684  %and = or i1 %cmp0, %cmp1
685  %sel = select i1 %and, i64 %val5, i64 %val6
686  ret i64 %sel
687
688; CHECK: fun45
689; CHECK: cost of 3 for instruction:   %cmp0 = icmp eq i16 %val1, %val2
690; CHECK: cost of 3 for instruction:   %cmp1 = icmp eq i16 %val3, %val4
691; CHECK: cost of 1 for instruction:   %and = or i1 %cmp0, %cmp1
692; CHECK: cost of 1 for instruction:   %sel = select i1 %and, i64 %val5, i64 %val6
693}
694
695define float @fun46(i16 %val1, i16 %val2, i16 %val3, i16 %val4,
696                    float %val5, float %val6) {
697  %cmp0 = icmp eq i16 %val1, %val2
698  %cmp1 = icmp eq i16 %val3, %val4
699  %and = or i1 %cmp0, %cmp1
700  %sel = select i1 %and, float %val5, float %val6
701  ret float %sel
702
703; CHECK: fun46
704; CHECK: cost of 3 for instruction:   %cmp0 = icmp eq i16 %val1, %val2
705; CHECK: cost of 3 for instruction:   %cmp1 = icmp eq i16 %val3, %val4
706; CHECK: cost of 1 for instruction:   %and = or i1 %cmp0, %cmp1
707; CHECK: cost of 4 for instruction:   %sel = select i1 %and, float %val5, float %val6
708}
709
710define double @fun47(i16 %val1, i16 %val2, i16 %val3, i16 %val4,
711                     double %val5, double %val6) {
712  %cmp0 = icmp eq i16 %val1, %val2
713  %cmp1 = icmp eq i16 %val3, %val4
714  %and = or i1 %cmp0, %cmp1
715  %sel = select i1 %and, double %val5, double %val6
716  ret double %sel
717
718; CHECK: fun47
719; CHECK: cost of 3 for instruction:   %cmp0 = icmp eq i16 %val1, %val2
720; CHECK: cost of 3 for instruction:   %cmp1 = icmp eq i16 %val3, %val4
721; CHECK: cost of 1 for instruction:   %and = or i1 %cmp0, %cmp1
722; CHECK: cost of 4 for instruction:   %sel = select i1 %and, double %val5, double %val6
723}
724
725define i8 @fun48(i32 %val1, i32 %val2, i32 %val3, i32 %val4,
726                 i8 %val5, i8 %val6) {
727  %cmp0 = icmp eq i32 %val1, %val2
728  %cmp1 = icmp eq i32 %val3, %val4
729  %and = or i1 %cmp0, %cmp1
730  %sel = select i1 %and, i8 %val5, i8 %val6
731  ret i8 %sel
732
733; CHECK: fun48
734; CHECK: cost of 1 for instruction:   %cmp0 = icmp eq i32 %val1, %val2
735; CHECK: cost of 1 for instruction:   %cmp1 = icmp eq i32 %val3, %val4
736; CHECK: cost of 1 for instruction:   %and = or i1 %cmp0, %cmp1
737; CHECK: cost of 1 for instruction:   %sel = select i1 %and, i8 %val5, i8 %val6
738}
739
740define i16 @fun49(i32 %val1, i32 %val2, i32 %val3, i32 %val4,
741                  i16 %val5, i16 %val6) {
742  %cmp0 = icmp eq i32 %val1, %val2
743  %cmp1 = icmp eq i32 %val3, %val4
744  %and = or i1 %cmp0, %cmp1
745  %sel = select i1 %and, i16 %val5, i16 %val6
746  ret i16 %sel
747
748; CHECK: fun49
749; CHECK: cost of 1 for instruction:   %cmp0 = icmp eq i32 %val1, %val2
750; CHECK: cost of 1 for instruction:   %cmp1 = icmp eq i32 %val3, %val4
751; CHECK: cost of 1 for instruction:   %and = or i1 %cmp0, %cmp1
752; CHECK: cost of 1 for instruction:   %sel = select i1 %and, i16 %val5, i16 %val6
753}
754
755define i32 @fun50(i32 %val1, i32 %val2, i32 %val3, i32 %val4,
756                  i32 %val5, i32 %val6) {
757  %cmp0 = icmp eq i32 %val1, %val2
758  %cmp1 = icmp eq i32 %val3, %val4
759  %and = or i1 %cmp0, %cmp1
760  %sel = select i1 %and, i32 %val5, i32 %val6
761  ret i32 %sel
762
763; CHECK: fun50
764; CHECK: cost of 1 for instruction:   %cmp0 = icmp eq i32 %val1, %val2
765; CHECK: cost of 1 for instruction:   %cmp1 = icmp eq i32 %val3, %val4
766; CHECK: cost of 1 for instruction:   %and = or i1 %cmp0, %cmp1
767; CHECK: cost of 1 for instruction:   %sel = select i1 %and, i32 %val5, i32 %val6
768}
769
770define i64 @fun51(i32 %val1, i32 %val2, i32 %val3, i32 %val4,
771                  i64 %val5, i64 %val6) {
772  %cmp0 = icmp eq i32 %val1, %val2
773  %cmp1 = icmp eq i32 %val3, %val4
774  %and = or i1 %cmp0, %cmp1
775  %sel = select i1 %and, i64 %val5, i64 %val6
776  ret i64 %sel
777
778; CHECK: fun51
779; CHECK: cost of 1 for instruction:   %cmp0 = icmp eq i32 %val1, %val2
780; CHECK: cost of 1 for instruction:   %cmp1 = icmp eq i32 %val3, %val4
781; CHECK: cost of 1 for instruction:   %and = or i1 %cmp0, %cmp1
782; CHECK: cost of 1 for instruction:   %sel = select i1 %and, i64 %val5, i64 %val6
783}
784
785define float @fun52(i32 %val1, i32 %val2, i32 %val3, i32 %val4,
786                    float %val5, float %val6) {
787  %cmp0 = icmp eq i32 %val1, %val2
788  %cmp1 = icmp eq i32 %val3, %val4
789  %and = or i1 %cmp0, %cmp1
790  %sel = select i1 %and, float %val5, float %val6
791  ret float %sel
792
793; CHECK: fun52
794; CHECK: cost of 1 for instruction:   %cmp0 = icmp eq i32 %val1, %val2
795; CHECK: cost of 1 for instruction:   %cmp1 = icmp eq i32 %val3, %val4
796; CHECK: cost of 1 for instruction:   %and = or i1 %cmp0, %cmp1
797; CHECK: cost of 4 for instruction:   %sel = select i1 %and, float %val5, float %val6
798}
799
800define double @fun53(i32 %val1, i32 %val2, i32 %val3, i32 %val4,
801                     double %val5, double %val6) {
802  %cmp0 = icmp eq i32 %val1, %val2
803  %cmp1 = icmp eq i32 %val3, %val4
804  %and = or i1 %cmp0, %cmp1
805  %sel = select i1 %and, double %val5, double %val6
806  ret double %sel
807
808; CHECK: fun53
809; CHECK: cost of 1 for instruction:   %cmp0 = icmp eq i32 %val1, %val2
810; CHECK: cost of 1 for instruction:   %cmp1 = icmp eq i32 %val3, %val4
811; CHECK: cost of 1 for instruction:   %and = or i1 %cmp0, %cmp1
812; CHECK: cost of 4 for instruction:   %sel = select i1 %and, double %val5, double %val6
813}
814
815define i8 @fun54(i64 %val1, i64 %val2, i64 %val3, i64 %val4,
816                 i8 %val5, i8 %val6) {
817  %cmp0 = icmp eq i64 %val1, %val2
818  %cmp1 = icmp eq i64 %val3, %val4
819  %and = or i1 %cmp0, %cmp1
820  %sel = select i1 %and, i8 %val5, i8 %val6
821  ret i8 %sel
822
823; CHECK: fun54
824; CHECK: cost of 1 for instruction:   %cmp0 = icmp eq i64 %val1, %val2
825; CHECK: cost of 1 for instruction:   %cmp1 = icmp eq i64 %val3, %val4
826; CHECK: cost of 1 for instruction:   %and = or i1 %cmp0, %cmp1
827; CHECK: cost of 1 for instruction:   %sel = select i1 %and, i8 %val5, i8 %val6
828}
829
830define i16 @fun55(i64 %val1, i64 %val2, i64 %val3, i64 %val4,
831                  i16 %val5, i16 %val6) {
832  %cmp0 = icmp eq i64 %val1, %val2
833  %cmp1 = icmp eq i64 %val3, %val4
834  %and = or i1 %cmp0, %cmp1
835  %sel = select i1 %and, i16 %val5, i16 %val6
836  ret i16 %sel
837
838; CHECK: fun55
839; CHECK: cost of 1 for instruction:   %cmp0 = icmp eq i64 %val1, %val2
840; CHECK: cost of 1 for instruction:   %cmp1 = icmp eq i64 %val3, %val4
841; CHECK: cost of 1 for instruction:   %and = or i1 %cmp0, %cmp1
842; CHECK: cost of 1 for instruction:   %sel = select i1 %and, i16 %val5, i16 %val6
843}
844
845define i32 @fun56(i64 %val1, i64 %val2, i64 %val3, i64 %val4,
846                  i32 %val5, i32 %val6) {
847  %cmp0 = icmp eq i64 %val1, %val2
848  %cmp1 = icmp eq i64 %val3, %val4
849  %and = or i1 %cmp0, %cmp1
850  %sel = select i1 %and, i32 %val5, i32 %val6
851  ret i32 %sel
852
853; CHECK: fun56
854; CHECK: cost of 1 for instruction:   %cmp0 = icmp eq i64 %val1, %val2
855; CHECK: cost of 1 for instruction:   %cmp1 = icmp eq i64 %val3, %val4
856; CHECK: cost of 1 for instruction:   %and = or i1 %cmp0, %cmp1
857; CHECK: cost of 1 for instruction:   %sel = select i1 %and, i32 %val5, i32 %val6
858}
859
860define i64 @fun57(i64 %val1, i64 %val2, i64 %val3, i64 %val4,
861                  i64 %val5, i64 %val6) {
862  %cmp0 = icmp eq i64 %val1, %val2
863  %cmp1 = icmp eq i64 %val3, %val4
864  %and = or i1 %cmp0, %cmp1
865  %sel = select i1 %and, i64 %val5, i64 %val6
866  ret i64 %sel
867
868; CHECK: fun57
869; CHECK: cost of 1 for instruction:   %cmp0 = icmp eq i64 %val1, %val2
870; CHECK: cost of 1 for instruction:   %cmp1 = icmp eq i64 %val3, %val4
871; CHECK: cost of 1 for instruction:   %and = or i1 %cmp0, %cmp1
872; CHECK: cost of 1 for instruction:   %sel = select i1 %and, i64 %val5, i64 %val6
873}
874
875define float @fun58(i64 %val1, i64 %val2, i64 %val3, i64 %val4,
876                    float %val5, float %val6) {
877  %cmp0 = icmp eq i64 %val1, %val2
878  %cmp1 = icmp eq i64 %val3, %val4
879  %and = or i1 %cmp0, %cmp1
880  %sel = select i1 %and, float %val5, float %val6
881  ret float %sel
882
883; CHECK: fun58
884; CHECK: cost of 1 for instruction:   %cmp0 = icmp eq i64 %val1, %val2
885; CHECK: cost of 1 for instruction:   %cmp1 = icmp eq i64 %val3, %val4
886; CHECK: cost of 1 for instruction:   %and = or i1 %cmp0, %cmp1
887; CHECK: cost of 4 for instruction:   %sel = select i1 %and, float %val5, float %val6
888}
889
890define double @fun59(i64 %val1, i64 %val2, i64 %val3, i64 %val4,
891                     double %val5, double %val6) {
892  %cmp0 = icmp eq i64 %val1, %val2
893  %cmp1 = icmp eq i64 %val3, %val4
894  %and = or i1 %cmp0, %cmp1
895  %sel = select i1 %and, double %val5, double %val6
896  ret double %sel
897
898; CHECK: fun59
899; CHECK: cost of 1 for instruction:   %cmp0 = icmp eq i64 %val1, %val2
900; CHECK: cost of 1 for instruction:   %cmp1 = icmp eq i64 %val3, %val4
901; CHECK: cost of 1 for instruction:   %and = or i1 %cmp0, %cmp1
902; CHECK: cost of 4 for instruction:   %sel = select i1 %and, double %val5, double %val6
903}
904
905define i8 @fun60(float %val1, float %val2, float %val3, float %val4,
906                 i8 %val5, i8 %val6) {
907  %cmp0 = fcmp ogt float %val1, %val2
908  %cmp1 = fcmp ogt float %val3, %val4
909  %and = or i1 %cmp0, %cmp1
910  %sel = select i1 %and, i8 %val5, i8 %val6
911  ret i8 %sel
912
913; CHECK: fun60
914; CHECK: cost of 1 for instruction:   %cmp0 = fcmp ogt float %val1, %val2
915; CHECK: cost of 1 for instruction:   %cmp1 = fcmp ogt float %val3, %val4
916; CHECK: cost of 1 for instruction:   %and = or i1 %cmp0, %cmp1
917; CHECK: cost of 1 for instruction:   %sel = select i1 %and, i8 %val5, i8 %val6
918}
919
920define i16 @fun61(float %val1, float %val2, float %val3, float %val4,
921                  i16 %val5, i16 %val6) {
922  %cmp0 = fcmp ogt float %val1, %val2
923  %cmp1 = fcmp ogt float %val3, %val4
924  %and = or i1 %cmp0, %cmp1
925  %sel = select i1 %and, i16 %val5, i16 %val6
926  ret i16 %sel
927
928; CHECK: fun61
929; CHECK: cost of 1 for instruction:   %cmp0 = fcmp ogt float %val1, %val2
930; CHECK: cost of 1 for instruction:   %cmp1 = fcmp ogt float %val3, %val4
931; CHECK: cost of 1 for instruction:   %and = or i1 %cmp0, %cmp1
932; CHECK: cost of 1 for instruction:   %sel = select i1 %and, i16 %val5, i16 %val6
933}
934
935define i32 @fun62(float %val1, float %val2, float %val3, float %val4,
936                  i32 %val5, i32 %val6) {
937  %cmp0 = fcmp ogt float %val1, %val2
938  %cmp1 = fcmp ogt float %val3, %val4
939  %and = or i1 %cmp0, %cmp1
940  %sel = select i1 %and, i32 %val5, i32 %val6
941  ret i32 %sel
942
943; CHECK: fun62
944; CHECK: cost of 1 for instruction:   %cmp0 = fcmp ogt float %val1, %val2
945; CHECK: cost of 1 for instruction:   %cmp1 = fcmp ogt float %val3, %val4
946; CHECK: cost of 1 for instruction:   %and = or i1 %cmp0, %cmp1
947; CHECK: cost of 1 for instruction:   %sel = select i1 %and, i32 %val5, i32 %val6
948}
949
950define i64 @fun63(float %val1, float %val2, float %val3, float %val4,
951                  i64 %val5, i64 %val6) {
952  %cmp0 = fcmp ogt float %val1, %val2
953  %cmp1 = fcmp ogt float %val3, %val4
954  %and = or i1 %cmp0, %cmp1
955  %sel = select i1 %and, i64 %val5, i64 %val6
956  ret i64 %sel
957
958; CHECK: fun63
959; CHECK: cost of 1 for instruction:   %cmp0 = fcmp ogt float %val1, %val2
960; CHECK: cost of 1 for instruction:   %cmp1 = fcmp ogt float %val3, %val4
961; CHECK: cost of 1 for instruction:   %and = or i1 %cmp0, %cmp1
962; CHECK: cost of 1 for instruction:   %sel = select i1 %and, i64 %val5, i64 %val6
963}
964
965define float @fun64(float %val1, float %val2, float %val3, float %val4,
966                    float %val5, float %val6) {
967  %cmp0 = fcmp ogt float %val1, %val2
968  %cmp1 = fcmp ogt float %val3, %val4
969  %and = or i1 %cmp0, %cmp1
970  %sel = select i1 %and, float %val5, float %val6
971  ret float %sel
972
973; CHECK: fun64
974; CHECK: cost of 1 for instruction:   %cmp0 = fcmp ogt float %val1, %val2
975; CHECK: cost of 1 for instruction:   %cmp1 = fcmp ogt float %val3, %val4
976; CHECK: cost of 1 for instruction:   %and = or i1 %cmp0, %cmp1
977; CHECK: cost of 4 for instruction:   %sel = select i1 %and, float %val5, float %val6
978}
979
980define double @fun65(float %val1, float %val2, float %val3, float %val4,
981                     double %val5, double %val6) {
982  %cmp0 = fcmp ogt float %val1, %val2
983  %cmp1 = fcmp ogt float %val3, %val4
984  %and = or i1 %cmp0, %cmp1
985  %sel = select i1 %and, double %val5, double %val6
986  ret double %sel
987
988; CHECK: fun65
989; CHECK: cost of 1 for instruction:   %cmp0 = fcmp ogt float %val1, %val2
990; CHECK: cost of 1 for instruction:   %cmp1 = fcmp ogt float %val3, %val4
991; CHECK: cost of 1 for instruction:   %and = or i1 %cmp0, %cmp1
992; CHECK: cost of 4 for instruction:   %sel = select i1 %and, double %val5, double %val6
993}
994
995define i8 @fun66(double %val1, double %val2, double %val3, double %val4,
996                 i8 %val5, i8 %val6) {
997  %cmp0 = fcmp ogt double %val1, %val2
998  %cmp1 = fcmp ogt double %val3, %val4
999  %and = or i1 %cmp0, %cmp1
1000  %sel = select i1 %and, i8 %val5, i8 %val6
1001  ret i8 %sel
1002
1003; CHECK: fun66
1004; CHECK: cost of 1 for instruction:   %cmp0 = fcmp ogt double %val1, %val2
1005; CHECK: cost of 1 for instruction:   %cmp1 = fcmp ogt double %val3, %val4
1006; CHECK: cost of 1 for instruction:   %and = or i1 %cmp0, %cmp1
1007; CHECK: cost of 1 for instruction:   %sel = select i1 %and, i8 %val5, i8 %val6
1008}
1009
1010define i16 @fun67(double %val1, double %val2, double %val3, double %val4,
1011                  i16 %val5, i16 %val6) {
1012  %cmp0 = fcmp ogt double %val1, %val2
1013  %cmp1 = fcmp ogt double %val3, %val4
1014  %and = or i1 %cmp0, %cmp1
1015  %sel = select i1 %and, i16 %val5, i16 %val6
1016  ret i16 %sel
1017
1018; CHECK: fun67
1019; CHECK: cost of 1 for instruction:   %cmp0 = fcmp ogt double %val1, %val2
1020; CHECK: cost of 1 for instruction:   %cmp1 = fcmp ogt double %val3, %val4
1021; CHECK: cost of 1 for instruction:   %and = or i1 %cmp0, %cmp1
1022; CHECK: cost of 1 for instruction:   %sel = select i1 %and, i16 %val5, i16 %val6
1023}
1024
1025define i32 @fun68(double %val1, double %val2, double %val3, double %val4,
1026                  i32 %val5, i32 %val6) {
1027  %cmp0 = fcmp ogt double %val1, %val2
1028  %cmp1 = fcmp ogt double %val3, %val4
1029  %and = or i1 %cmp0, %cmp1
1030  %sel = select i1 %and, i32 %val5, i32 %val6
1031  ret i32 %sel
1032
1033; CHECK: fun68
1034; CHECK: cost of 1 for instruction:   %cmp0 = fcmp ogt double %val1, %val2
1035; CHECK: cost of 1 for instruction:   %cmp1 = fcmp ogt double %val3, %val4
1036; CHECK: cost of 1 for instruction:   %and = or i1 %cmp0, %cmp1
1037; CHECK: cost of 1 for instruction:   %sel = select i1 %and, i32 %val5, i32 %val6
1038}
1039
1040define i64 @fun69(double %val1, double %val2, double %val3, double %val4,
1041                  i64 %val5, i64 %val6) {
1042  %cmp0 = fcmp ogt double %val1, %val2
1043  %cmp1 = fcmp ogt double %val3, %val4
1044  %and = or i1 %cmp0, %cmp1
1045  %sel = select i1 %and, i64 %val5, i64 %val6
1046  ret i64 %sel
1047
1048; CHECK: fun69
1049; CHECK: cost of 1 for instruction:   %cmp0 = fcmp ogt double %val1, %val2
1050; CHECK: cost of 1 for instruction:   %cmp1 = fcmp ogt double %val3, %val4
1051; CHECK: cost of 1 for instruction:   %and = or i1 %cmp0, %cmp1
1052; CHECK: cost of 1 for instruction:   %sel = select i1 %and, i64 %val5, i64 %val6
1053}
1054
1055define float @fun70(double %val1, double %val2, double %val3, double %val4,
1056                    float %val5, float %val6) {
1057  %cmp0 = fcmp ogt double %val1, %val2
1058  %cmp1 = fcmp ogt double %val3, %val4
1059  %and = or i1 %cmp0, %cmp1
1060  %sel = select i1 %and, float %val5, float %val6
1061  ret float %sel
1062
1063; CHECK: fun70
1064; CHECK: cost of 1 for instruction:   %cmp0 = fcmp ogt double %val1, %val2
1065; CHECK: cost of 1 for instruction:   %cmp1 = fcmp ogt double %val3, %val4
1066; CHECK: cost of 1 for instruction:   %and = or i1 %cmp0, %cmp1
1067; CHECK: cost of 4 for instruction:   %sel = select i1 %and, float %val5, float %val6
1068}
1069
1070define double @fun71(double %val1, double %val2, double %val3, double %val4,
1071                     double %val5, double %val6) {
1072  %cmp0 = fcmp ogt double %val1, %val2
1073  %cmp1 = fcmp ogt double %val3, %val4
1074  %and = or i1 %cmp0, %cmp1
1075  %sel = select i1 %and, double %val5, double %val6
1076  ret double %sel
1077
1078; CHECK: fun71
1079; CHECK: cost of 1 for instruction:   %cmp0 = fcmp ogt double %val1, %val2
1080; CHECK: cost of 1 for instruction:   %cmp1 = fcmp ogt double %val3, %val4
1081; CHECK: cost of 1 for instruction:   %and = or i1 %cmp0, %cmp1
1082; CHECK: cost of 4 for instruction:   %sel = select i1 %and, double %val5, double %val6
1083}
1084
1085define i8 @fun72(i8 %val1, i8 %val2, i8 %val3, i8 %val4,
1086                 i8 %val5, i8 %val6) {
1087  %cmp0 = icmp eq i8 %val1, %val2
1088  %cmp1 = icmp eq i8 %val3, %val4
1089  %and = xor i1 %cmp0, %cmp1
1090  %sel = select i1 %and, i8 %val5, i8 %val6
1091  ret i8 %sel
1092
1093; CHECK: fun72
1094; CHECK: cost of 3 for instruction:   %cmp0 = icmp eq i8 %val1, %val2
1095; CHECK: cost of 3 for instruction:   %cmp1 = icmp eq i8 %val3, %val4
1096; CHECK: cost of 7 for instruction:   %and = xor i1 %cmp0, %cmp1
1097; CHECK: cost of 1 for instruction:   %sel = select i1 %and, i8 %val5, i8 %val6
1098}
1099
1100define i16 @fun73(i8 %val1, i8 %val2, i8 %val3, i8 %val4,
1101                  i16 %val5, i16 %val6) {
1102  %cmp0 = icmp eq i8 %val1, %val2
1103  %cmp1 = icmp eq i8 %val3, %val4
1104  %and = xor i1 %cmp0, %cmp1
1105  %sel = select i1 %and, i16 %val5, i16 %val6
1106  ret i16 %sel
1107
1108; CHECK: fun73
1109; CHECK: cost of 3 for instruction:   %cmp0 = icmp eq i8 %val1, %val2
1110; CHECK: cost of 3 for instruction:   %cmp1 = icmp eq i8 %val3, %val4
1111; CHECK: cost of 7 for instruction:   %and = xor i1 %cmp0, %cmp1
1112; CHECK: cost of 1 for instruction:   %sel = select i1 %and, i16 %val5, i16 %val6
1113}
1114
1115define i32 @fun74(i8 %val1, i8 %val2, i8 %val3, i8 %val4,
1116                  i32 %val5, i32 %val6) {
1117  %cmp0 = icmp eq i8 %val1, %val2
1118  %cmp1 = icmp eq i8 %val3, %val4
1119  %and = xor i1 %cmp0, %cmp1
1120  %sel = select i1 %and, i32 %val5, i32 %val6
1121  ret i32 %sel
1122
1123; CHECK: fun74
1124; CHECK: cost of 3 for instruction:   %cmp0 = icmp eq i8 %val1, %val2
1125; CHECK: cost of 3 for instruction:   %cmp1 = icmp eq i8 %val3, %val4
1126; CHECK: cost of 7 for instruction:   %and = xor i1 %cmp0, %cmp1
1127; CHECK: cost of 1 for instruction:   %sel = select i1 %and, i32 %val5, i32 %val6
1128}
1129
1130define i64 @fun75(i8 %val1, i8 %val2, i8 %val3, i8 %val4,
1131                  i64 %val5, i64 %val6) {
1132  %cmp0 = icmp eq i8 %val1, %val2
1133  %cmp1 = icmp eq i8 %val3, %val4
1134  %and = xor i1 %cmp0, %cmp1
1135  %sel = select i1 %and, i64 %val5, i64 %val6
1136  ret i64 %sel
1137
1138; CHECK: fun75
1139; CHECK: cost of 3 for instruction:   %cmp0 = icmp eq i8 %val1, %val2
1140; CHECK: cost of 3 for instruction:   %cmp1 = icmp eq i8 %val3, %val4
1141; CHECK: cost of 7 for instruction:   %and = xor i1 %cmp0, %cmp1
1142; CHECK: cost of 1 for instruction:   %sel = select i1 %and, i64 %val5, i64 %val6
1143}
1144
1145define float @fun76(i8 %val1, i8 %val2, i8 %val3, i8 %val4,
1146                    float %val5, float %val6) {
1147  %cmp0 = icmp eq i8 %val1, %val2
1148  %cmp1 = icmp eq i8 %val3, %val4
1149  %and = xor i1 %cmp0, %cmp1
1150  %sel = select i1 %and, float %val5, float %val6
1151  ret float %sel
1152
1153; CHECK: fun76
1154; CHECK: cost of 3 for instruction:   %cmp0 = icmp eq i8 %val1, %val2
1155; CHECK: cost of 3 for instruction:   %cmp1 = icmp eq i8 %val3, %val4
1156; CHECK: cost of 7 for instruction:   %and = xor i1 %cmp0, %cmp1
1157; CHECK: cost of 4 for instruction:   %sel = select i1 %and, float %val5, float %val6
1158}
1159
1160define double @fun77(i8 %val1, i8 %val2, i8 %val3, i8 %val4,
1161                     double %val5, double %val6) {
1162  %cmp0 = icmp eq i8 %val1, %val2
1163  %cmp1 = icmp eq i8 %val3, %val4
1164  %and = xor i1 %cmp0, %cmp1
1165  %sel = select i1 %and, double %val5, double %val6
1166  ret double %sel
1167
1168; CHECK: fun77
1169; CHECK: cost of 3 for instruction:   %cmp0 = icmp eq i8 %val1, %val2
1170; CHECK: cost of 3 for instruction:   %cmp1 = icmp eq i8 %val3, %val4
1171; CHECK: cost of 7 for instruction:   %and = xor i1 %cmp0, %cmp1
1172; CHECK: cost of 4 for instruction:   %sel = select i1 %and, double %val5, double %val6
1173}
1174
1175define i8 @fun78(i16 %val1, i16 %val2, i16 %val3, i16 %val4,
1176                 i8 %val5, i8 %val6) {
1177  %cmp0 = icmp eq i16 %val1, %val2
1178  %cmp1 = icmp eq i16 %val3, %val4
1179  %and = xor i1 %cmp0, %cmp1
1180  %sel = select i1 %and, i8 %val5, i8 %val6
1181  ret i8 %sel
1182
1183; CHECK: fun78
1184; CHECK: cost of 3 for instruction:   %cmp0 = icmp eq i16 %val1, %val2
1185; CHECK: cost of 3 for instruction:   %cmp1 = icmp eq i16 %val3, %val4
1186; CHECK: cost of 7 for instruction:   %and = xor i1 %cmp0, %cmp1
1187; CHECK: cost of 1 for instruction:   %sel = select i1 %and, i8 %val5, i8 %val6
1188}
1189
1190define i16 @fun79(i16 %val1, i16 %val2, i16 %val3, i16 %val4,
1191                  i16 %val5, i16 %val6) {
1192  %cmp0 = icmp eq i16 %val1, %val2
1193  %cmp1 = icmp eq i16 %val3, %val4
1194  %and = xor i1 %cmp0, %cmp1
1195  %sel = select i1 %and, i16 %val5, i16 %val6
1196  ret i16 %sel
1197
1198; CHECK: fun79
1199; CHECK: cost of 3 for instruction:   %cmp0 = icmp eq i16 %val1, %val2
1200; CHECK: cost of 3 for instruction:   %cmp1 = icmp eq i16 %val3, %val4
1201; CHECK: cost of 7 for instruction:   %and = xor i1 %cmp0, %cmp1
1202; CHECK: cost of 1 for instruction:   %sel = select i1 %and, i16 %val5, i16 %val6
1203}
1204
1205define i32 @fun80(i16 %val1, i16 %val2, i16 %val3, i16 %val4,
1206                  i32 %val5, i32 %val6) {
1207  %cmp0 = icmp eq i16 %val1, %val2
1208  %cmp1 = icmp eq i16 %val3, %val4
1209  %and = xor i1 %cmp0, %cmp1
1210  %sel = select i1 %and, i32 %val5, i32 %val6
1211  ret i32 %sel
1212
1213; CHECK: fun80
1214; CHECK: cost of 3 for instruction:   %cmp0 = icmp eq i16 %val1, %val2
1215; CHECK: cost of 3 for instruction:   %cmp1 = icmp eq i16 %val3, %val4
1216; CHECK: cost of 7 for instruction:   %and = xor i1 %cmp0, %cmp1
1217; CHECK: cost of 1 for instruction:   %sel = select i1 %and, i32 %val5, i32 %val6
1218}
1219
1220define i64 @fun81(i16 %val1, i16 %val2, i16 %val3, i16 %val4,
1221                  i64 %val5, i64 %val6) {
1222  %cmp0 = icmp eq i16 %val1, %val2
1223  %cmp1 = icmp eq i16 %val3, %val4
1224  %and = xor i1 %cmp0, %cmp1
1225  %sel = select i1 %and, i64 %val5, i64 %val6
1226  ret i64 %sel
1227
1228; CHECK: fun81
1229; CHECK: cost of 3 for instruction:   %cmp0 = icmp eq i16 %val1, %val2
1230; CHECK: cost of 3 for instruction:   %cmp1 = icmp eq i16 %val3, %val4
1231; CHECK: cost of 7 for instruction:   %and = xor i1 %cmp0, %cmp1
1232; CHECK: cost of 1 for instruction:   %sel = select i1 %and, i64 %val5, i64 %val6
1233}
1234
1235define float @fun82(i16 %val1, i16 %val2, i16 %val3, i16 %val4,
1236                    float %val5, float %val6) {
1237  %cmp0 = icmp eq i16 %val1, %val2
1238  %cmp1 = icmp eq i16 %val3, %val4
1239  %and = xor i1 %cmp0, %cmp1
1240  %sel = select i1 %and, float %val5, float %val6
1241  ret float %sel
1242
1243; CHECK: fun82
1244; CHECK: cost of 3 for instruction:   %cmp0 = icmp eq i16 %val1, %val2
1245; CHECK: cost of 3 for instruction:   %cmp1 = icmp eq i16 %val3, %val4
1246; CHECK: cost of 7 for instruction:   %and = xor i1 %cmp0, %cmp1
1247; CHECK: cost of 4 for instruction:   %sel = select i1 %and, float %val5, float %val6
1248}
1249
1250define double @fun83(i16 %val1, i16 %val2, i16 %val3, i16 %val4,
1251                     double %val5, double %val6) {
1252  %cmp0 = icmp eq i16 %val1, %val2
1253  %cmp1 = icmp eq i16 %val3, %val4
1254  %and = xor i1 %cmp0, %cmp1
1255  %sel = select i1 %and, double %val5, double %val6
1256  ret double %sel
1257
1258; CHECK: fun83
1259; CHECK: cost of 3 for instruction:   %cmp0 = icmp eq i16 %val1, %val2
1260; CHECK: cost of 3 for instruction:   %cmp1 = icmp eq i16 %val3, %val4
1261; CHECK: cost of 7 for instruction:   %and = xor i1 %cmp0, %cmp1
1262; CHECK: cost of 4 for instruction:   %sel = select i1 %and, double %val5, double %val6
1263}
1264
1265define i8 @fun84(i32 %val1, i32 %val2, i32 %val3, i32 %val4,
1266                 i8 %val5, i8 %val6) {
1267  %cmp0 = icmp eq i32 %val1, %val2
1268  %cmp1 = icmp eq i32 %val3, %val4
1269  %and = xor i1 %cmp0, %cmp1
1270  %sel = select i1 %and, i8 %val5, i8 %val6
1271  ret i8 %sel
1272
1273; CHECK: fun84
1274; CHECK: cost of 1 for instruction:   %cmp0 = icmp eq i32 %val1, %val2
1275; CHECK: cost of 1 for instruction:   %cmp1 = icmp eq i32 %val3, %val4
1276; CHECK: cost of 7 for instruction:   %and = xor i1 %cmp0, %cmp1
1277; CHECK: cost of 1 for instruction:   %sel = select i1 %and, i8 %val5, i8 %val6
1278}
1279
1280define i16 @fun85(i32 %val1, i32 %val2, i32 %val3, i32 %val4,
1281                  i16 %val5, i16 %val6) {
1282  %cmp0 = icmp eq i32 %val1, %val2
1283  %cmp1 = icmp eq i32 %val3, %val4
1284  %and = xor i1 %cmp0, %cmp1
1285  %sel = select i1 %and, i16 %val5, i16 %val6
1286  ret i16 %sel
1287
1288; CHECK: fun85
1289; CHECK: cost of 1 for instruction:   %cmp0 = icmp eq i32 %val1, %val2
1290; CHECK: cost of 1 for instruction:   %cmp1 = icmp eq i32 %val3, %val4
1291; CHECK: cost of 7 for instruction:   %and = xor i1 %cmp0, %cmp1
1292; CHECK: cost of 1 for instruction:   %sel = select i1 %and, i16 %val5, i16 %val6
1293}
1294
1295define i32 @fun86(i32 %val1, i32 %val2, i32 %val3, i32 %val4,
1296                  i32 %val5, i32 %val6) {
1297  %cmp0 = icmp eq i32 %val1, %val2
1298  %cmp1 = icmp eq i32 %val3, %val4
1299  %and = xor i1 %cmp0, %cmp1
1300  %sel = select i1 %and, i32 %val5, i32 %val6
1301  ret i32 %sel
1302
1303; CHECK: fun86
1304; CHECK: cost of 1 for instruction:   %cmp0 = icmp eq i32 %val1, %val2
1305; CHECK: cost of 1 for instruction:   %cmp1 = icmp eq i32 %val3, %val4
1306; CHECK: cost of 7 for instruction:   %and = xor i1 %cmp0, %cmp1
1307; CHECK: cost of 1 for instruction:   %sel = select i1 %and, i32 %val5, i32 %val6
1308}
1309
1310define i64 @fun87(i32 %val1, i32 %val2, i32 %val3, i32 %val4,
1311                  i64 %val5, i64 %val6) {
1312  %cmp0 = icmp eq i32 %val1, %val2
1313  %cmp1 = icmp eq i32 %val3, %val4
1314  %and = xor i1 %cmp0, %cmp1
1315  %sel = select i1 %and, i64 %val5, i64 %val6
1316  ret i64 %sel
1317
1318; CHECK: fun87
1319; CHECK: cost of 1 for instruction:   %cmp0 = icmp eq i32 %val1, %val2
1320; CHECK: cost of 1 for instruction:   %cmp1 = icmp eq i32 %val3, %val4
1321; CHECK: cost of 7 for instruction:   %and = xor i1 %cmp0, %cmp1
1322; CHECK: cost of 1 for instruction:   %sel = select i1 %and, i64 %val5, i64 %val6
1323}
1324
1325define float @fun88(i32 %val1, i32 %val2, i32 %val3, i32 %val4,
1326                    float %val5, float %val6) {
1327  %cmp0 = icmp eq i32 %val1, %val2
1328  %cmp1 = icmp eq i32 %val3, %val4
1329  %and = xor i1 %cmp0, %cmp1
1330  %sel = select i1 %and, float %val5, float %val6
1331  ret float %sel
1332
1333; CHECK: fun88
1334; CHECK: cost of 1 for instruction:   %cmp0 = icmp eq i32 %val1, %val2
1335; CHECK: cost of 1 for instruction:   %cmp1 = icmp eq i32 %val3, %val4
1336; CHECK: cost of 7 for instruction:   %and = xor i1 %cmp0, %cmp1
1337; CHECK: cost of 4 for instruction:   %sel = select i1 %and, float %val5, float %val6
1338}
1339
1340define double @fun89(i32 %val1, i32 %val2, i32 %val3, i32 %val4,
1341                     double %val5, double %val6) {
1342  %cmp0 = icmp eq i32 %val1, %val2
1343  %cmp1 = icmp eq i32 %val3, %val4
1344  %and = xor i1 %cmp0, %cmp1
1345  %sel = select i1 %and, double %val5, double %val6
1346  ret double %sel
1347
1348; CHECK: fun89
1349; CHECK: cost of 1 for instruction:   %cmp0 = icmp eq i32 %val1, %val2
1350; CHECK: cost of 1 for instruction:   %cmp1 = icmp eq i32 %val3, %val4
1351; CHECK: cost of 7 for instruction:   %and = xor i1 %cmp0, %cmp1
1352; CHECK: cost of 4 for instruction:   %sel = select i1 %and, double %val5, double %val6
1353}
1354
1355define i8 @fun90(i64 %val1, i64 %val2, i64 %val3, i64 %val4,
1356                 i8 %val5, i8 %val6) {
1357  %cmp0 = icmp eq i64 %val1, %val2
1358  %cmp1 = icmp eq i64 %val3, %val4
1359  %and = xor i1 %cmp0, %cmp1
1360  %sel = select i1 %and, i8 %val5, i8 %val6
1361  ret i8 %sel
1362
1363; CHECK: fun90
1364; CHECK: cost of 1 for instruction:   %cmp0 = icmp eq i64 %val1, %val2
1365; CHECK: cost of 1 for instruction:   %cmp1 = icmp eq i64 %val3, %val4
1366; CHECK: cost of 7 for instruction:   %and = xor i1 %cmp0, %cmp1
1367; CHECK: cost of 1 for instruction:   %sel = select i1 %and, i8 %val5, i8 %val6
1368}
1369
1370define i16 @fun91(i64 %val1, i64 %val2, i64 %val3, i64 %val4,
1371                  i16 %val5, i16 %val6) {
1372  %cmp0 = icmp eq i64 %val1, %val2
1373  %cmp1 = icmp eq i64 %val3, %val4
1374  %and = xor i1 %cmp0, %cmp1
1375  %sel = select i1 %and, i16 %val5, i16 %val6
1376  ret i16 %sel
1377
1378; CHECK: fun91
1379; CHECK: cost of 1 for instruction:   %cmp0 = icmp eq i64 %val1, %val2
1380; CHECK: cost of 1 for instruction:   %cmp1 = icmp eq i64 %val3, %val4
1381; CHECK: cost of 7 for instruction:   %and = xor i1 %cmp0, %cmp1
1382; CHECK: cost of 1 for instruction:   %sel = select i1 %and, i16 %val5, i16 %val6
1383}
1384
1385define i32 @fun92(i64 %val1, i64 %val2, i64 %val3, i64 %val4,
1386                  i32 %val5, i32 %val6) {
1387  %cmp0 = icmp eq i64 %val1, %val2
1388  %cmp1 = icmp eq i64 %val3, %val4
1389  %and = xor i1 %cmp0, %cmp1
1390  %sel = select i1 %and, i32 %val5, i32 %val6
1391  ret i32 %sel
1392
1393; CHECK: fun92
1394; CHECK: cost of 1 for instruction:   %cmp0 = icmp eq i64 %val1, %val2
1395; CHECK: cost of 1 for instruction:   %cmp1 = icmp eq i64 %val3, %val4
1396; CHECK: cost of 7 for instruction:   %and = xor i1 %cmp0, %cmp1
1397; CHECK: cost of 1 for instruction:   %sel = select i1 %and, i32 %val5, i32 %val6
1398}
1399
1400define i64 @fun93(i64 %val1, i64 %val2, i64 %val3, i64 %val4,
1401                  i64 %val5, i64 %val6) {
1402  %cmp0 = icmp eq i64 %val1, %val2
1403  %cmp1 = icmp eq i64 %val3, %val4
1404  %and = xor i1 %cmp0, %cmp1
1405  %sel = select i1 %and, i64 %val5, i64 %val6
1406  ret i64 %sel
1407
1408; CHECK: fun93
1409; CHECK: cost of 1 for instruction:   %cmp0 = icmp eq i64 %val1, %val2
1410; CHECK: cost of 1 for instruction:   %cmp1 = icmp eq i64 %val3, %val4
1411; CHECK: cost of 7 for instruction:   %and = xor i1 %cmp0, %cmp1
1412; CHECK: cost of 1 for instruction:   %sel = select i1 %and, i64 %val5, i64 %val6
1413}
1414
1415define float @fun94(i64 %val1, i64 %val2, i64 %val3, i64 %val4,
1416                    float %val5, float %val6) {
1417  %cmp0 = icmp eq i64 %val1, %val2
1418  %cmp1 = icmp eq i64 %val3, %val4
1419  %and = xor i1 %cmp0, %cmp1
1420  %sel = select i1 %and, float %val5, float %val6
1421  ret float %sel
1422
1423; CHECK: fun94
1424; CHECK: cost of 1 for instruction:   %cmp0 = icmp eq i64 %val1, %val2
1425; CHECK: cost of 1 for instruction:   %cmp1 = icmp eq i64 %val3, %val4
1426; CHECK: cost of 7 for instruction:   %and = xor i1 %cmp0, %cmp1
1427; CHECK: cost of 4 for instruction:   %sel = select i1 %and, float %val5, float %val6
1428}
1429
1430define double @fun95(i64 %val1, i64 %val2, i64 %val3, i64 %val4,
1431                     double %val5, double %val6) {
1432  %cmp0 = icmp eq i64 %val1, %val2
1433  %cmp1 = icmp eq i64 %val3, %val4
1434  %and = xor i1 %cmp0, %cmp1
1435  %sel = select i1 %and, double %val5, double %val6
1436  ret double %sel
1437
1438; CHECK: fun95
1439; CHECK: cost of 1 for instruction:   %cmp0 = icmp eq i64 %val1, %val2
1440; CHECK: cost of 1 for instruction:   %cmp1 = icmp eq i64 %val3, %val4
1441; CHECK: cost of 7 for instruction:   %and = xor i1 %cmp0, %cmp1
1442; CHECK: cost of 4 for instruction:   %sel = select i1 %and, double %val5, double %val6
1443}
1444
1445define i8 @fun96(float %val1, float %val2, float %val3, float %val4,
1446                 i8 %val5, i8 %val6) {
1447  %cmp0 = fcmp ogt float %val1, %val2
1448  %cmp1 = fcmp ogt float %val3, %val4
1449  %and = xor i1 %cmp0, %cmp1
1450  %sel = select i1 %and, i8 %val5, i8 %val6
1451  ret i8 %sel
1452
1453; CHECK: fun96
1454; CHECK: cost of 1 for instruction:   %cmp0 = fcmp ogt float %val1, %val2
1455; CHECK: cost of 1 for instruction:   %cmp1 = fcmp ogt float %val3, %val4
1456; CHECK: cost of 7 for instruction:   %and = xor i1 %cmp0, %cmp1
1457; CHECK: cost of 1 for instruction:   %sel = select i1 %and, i8 %val5, i8 %val6
1458}
1459
1460define i16 @fun97(float %val1, float %val2, float %val3, float %val4,
1461                  i16 %val5, i16 %val6) {
1462  %cmp0 = fcmp ogt float %val1, %val2
1463  %cmp1 = fcmp ogt float %val3, %val4
1464  %and = xor i1 %cmp0, %cmp1
1465  %sel = select i1 %and, i16 %val5, i16 %val6
1466  ret i16 %sel
1467
1468; CHECK: fun97
1469; CHECK: cost of 1 for instruction:   %cmp0 = fcmp ogt float %val1, %val2
1470; CHECK: cost of 1 for instruction:   %cmp1 = fcmp ogt float %val3, %val4
1471; CHECK: cost of 7 for instruction:   %and = xor i1 %cmp0, %cmp1
1472; CHECK: cost of 1 for instruction:   %sel = select i1 %and, i16 %val5, i16 %val6
1473}
1474
1475define i32 @fun98(float %val1, float %val2, float %val3, float %val4,
1476                  i32 %val5, i32 %val6) {
1477  %cmp0 = fcmp ogt float %val1, %val2
1478  %cmp1 = fcmp ogt float %val3, %val4
1479  %and = xor i1 %cmp0, %cmp1
1480  %sel = select i1 %and, i32 %val5, i32 %val6
1481  ret i32 %sel
1482
1483; CHECK: fun98
1484; CHECK: cost of 1 for instruction:   %cmp0 = fcmp ogt float %val1, %val2
1485; CHECK: cost of 1 for instruction:   %cmp1 = fcmp ogt float %val3, %val4
1486; CHECK: cost of 7 for instruction:   %and = xor i1 %cmp0, %cmp1
1487; CHECK: cost of 1 for instruction:   %sel = select i1 %and, i32 %val5, i32 %val6
1488}
1489
1490define i64 @fun99(float %val1, float %val2, float %val3, float %val4,
1491                  i64 %val5, i64 %val6) {
1492  %cmp0 = fcmp ogt float %val1, %val2
1493  %cmp1 = fcmp ogt float %val3, %val4
1494  %and = xor i1 %cmp0, %cmp1
1495  %sel = select i1 %and, i64 %val5, i64 %val6
1496  ret i64 %sel
1497
1498; CHECK: fun99
1499; CHECK: cost of 1 for instruction:   %cmp0 = fcmp ogt float %val1, %val2
1500; CHECK: cost of 1 for instruction:   %cmp1 = fcmp ogt float %val3, %val4
1501; CHECK: cost of 7 for instruction:   %and = xor i1 %cmp0, %cmp1
1502; CHECK: cost of 1 for instruction:   %sel = select i1 %and, i64 %val5, i64 %val6
1503}
1504
1505define float @fun100(float %val1, float %val2, float %val3, float %val4,
1506                     float %val5, float %val6) {
1507  %cmp0 = fcmp ogt float %val1, %val2
1508  %cmp1 = fcmp ogt float %val3, %val4
1509  %and = xor i1 %cmp0, %cmp1
1510  %sel = select i1 %and, float %val5, float %val6
1511  ret float %sel
1512
1513; CHECK: fun100
1514; CHECK: cost of 1 for instruction:   %cmp0 = fcmp ogt float %val1, %val2
1515; CHECK: cost of 1 for instruction:   %cmp1 = fcmp ogt float %val3, %val4
1516; CHECK: cost of 7 for instruction:   %and = xor i1 %cmp0, %cmp1
1517; CHECK: cost of 4 for instruction:   %sel = select i1 %and, float %val5, float %val6
1518}
1519
1520define double @fun101(float %val1, float %val2, float %val3, float %val4,
1521                      double %val5, double %val6) {
1522  %cmp0 = fcmp ogt float %val1, %val2
1523  %cmp1 = fcmp ogt float %val3, %val4
1524  %and = xor i1 %cmp0, %cmp1
1525  %sel = select i1 %and, double %val5, double %val6
1526  ret double %sel
1527
1528; CHECK: fun101
1529; CHECK: cost of 1 for instruction:   %cmp0 = fcmp ogt float %val1, %val2
1530; CHECK: cost of 1 for instruction:   %cmp1 = fcmp ogt float %val3, %val4
1531; CHECK: cost of 7 for instruction:   %and = xor i1 %cmp0, %cmp1
1532; CHECK: cost of 4 for instruction:   %sel = select i1 %and, double %val5, double %val6
1533}
1534
1535define i8 @fun102(double %val1, double %val2, double %val3, double %val4,
1536                  i8 %val5, i8 %val6) {
1537  %cmp0 = fcmp ogt double %val1, %val2
1538  %cmp1 = fcmp ogt double %val3, %val4
1539  %and = xor i1 %cmp0, %cmp1
1540  %sel = select i1 %and, i8 %val5, i8 %val6
1541  ret i8 %sel
1542
1543; CHECK: fun102
1544; CHECK: cost of 1 for instruction:   %cmp0 = fcmp ogt double %val1, %val2
1545; CHECK: cost of 1 for instruction:   %cmp1 = fcmp ogt double %val3, %val4
1546; CHECK: cost of 7 for instruction:   %and = xor i1 %cmp0, %cmp1
1547; CHECK: cost of 1 for instruction:   %sel = select i1 %and, i8 %val5, i8 %val6
1548}
1549
1550define i16 @fun103(double %val1, double %val2, double %val3, double %val4,
1551                   i16 %val5, i16 %val6) {
1552  %cmp0 = fcmp ogt double %val1, %val2
1553  %cmp1 = fcmp ogt double %val3, %val4
1554  %and = xor i1 %cmp0, %cmp1
1555  %sel = select i1 %and, i16 %val5, i16 %val6
1556  ret i16 %sel
1557
1558; CHECK: fun103
1559; CHECK: cost of 1 for instruction:   %cmp0 = fcmp ogt double %val1, %val2
1560; CHECK: cost of 1 for instruction:   %cmp1 = fcmp ogt double %val3, %val4
1561; CHECK: cost of 7 for instruction:   %and = xor i1 %cmp0, %cmp1
1562; CHECK: cost of 1 for instruction:   %sel = select i1 %and, i16 %val5, i16 %val6
1563}
1564
1565define i32 @fun104(double %val1, double %val2, double %val3, double %val4,
1566                   i32 %val5, i32 %val6) {
1567  %cmp0 = fcmp ogt double %val1, %val2
1568  %cmp1 = fcmp ogt double %val3, %val4
1569  %and = xor i1 %cmp0, %cmp1
1570  %sel = select i1 %and, i32 %val5, i32 %val6
1571  ret i32 %sel
1572
1573; CHECK: fun104
1574; CHECK: cost of 1 for instruction:   %cmp0 = fcmp ogt double %val1, %val2
1575; CHECK: cost of 1 for instruction:   %cmp1 = fcmp ogt double %val3, %val4
1576; CHECK: cost of 7 for instruction:   %and = xor i1 %cmp0, %cmp1
1577; CHECK: cost of 1 for instruction:   %sel = select i1 %and, i32 %val5, i32 %val6
1578}
1579
1580define i64 @fun105(double %val1, double %val2, double %val3, double %val4,
1581                   i64 %val5, i64 %val6) {
1582  %cmp0 = fcmp ogt double %val1, %val2
1583  %cmp1 = fcmp ogt double %val3, %val4
1584  %and = xor i1 %cmp0, %cmp1
1585  %sel = select i1 %and, i64 %val5, i64 %val6
1586  ret i64 %sel
1587
1588; CHECK: fun105
1589; CHECK: cost of 1 for instruction:   %cmp0 = fcmp ogt double %val1, %val2
1590; CHECK: cost of 1 for instruction:   %cmp1 = fcmp ogt double %val3, %val4
1591; CHECK: cost of 7 for instruction:   %and = xor i1 %cmp0, %cmp1
1592; CHECK: cost of 1 for instruction:   %sel = select i1 %and, i64 %val5, i64 %val6
1593}
1594
1595define float @fun106(double %val1, double %val2, double %val3, double %val4,
1596                     float %val5, float %val6) {
1597  %cmp0 = fcmp ogt double %val1, %val2
1598  %cmp1 = fcmp ogt double %val3, %val4
1599  %and = xor i1 %cmp0, %cmp1
1600  %sel = select i1 %and, float %val5, float %val6
1601  ret float %sel
1602
1603; CHECK: fun106
1604; CHECK: cost of 1 for instruction:   %cmp0 = fcmp ogt double %val1, %val2
1605; CHECK: cost of 1 for instruction:   %cmp1 = fcmp ogt double %val3, %val4
1606; CHECK: cost of 7 for instruction:   %and = xor i1 %cmp0, %cmp1
1607; CHECK: cost of 4 for instruction:   %sel = select i1 %and, float %val5, float %val6
1608}
1609
1610define double @fun107(double %val1, double %val2, double %val3, double %val4,
1611                      double %val5, double %val6) {
1612  %cmp0 = fcmp ogt double %val1, %val2
1613  %cmp1 = fcmp ogt double %val3, %val4
1614  %and = xor i1 %cmp0, %cmp1
1615  %sel = select i1 %and, double %val5, double %val6
1616  ret double %sel
1617
1618; CHECK: fun107
1619; CHECK: cost of 1 for instruction:   %cmp0 = fcmp ogt double %val1, %val2
1620; CHECK: cost of 1 for instruction:   %cmp1 = fcmp ogt double %val3, %val4
1621; CHECK: cost of 7 for instruction:   %and = xor i1 %cmp0, %cmp1
1622; CHECK: cost of 4 for instruction:   %sel = select i1 %and, double %val5, double %val6
1623}
1624
1625