3
3
4
4
; This is the canonical form for a type-changing min/max.
5
5
define double @t1 (float %a ) {
6
- ; CHECK-LABEL: define {{[^@]+}} @t1(
6
+ ; CHECK-LABEL: @t1(
7
7
; CHECK-NEXT: [[DOTINV:%.*]] = fcmp oge float [[A:%.*]], 5.000000e+00
8
8
; CHECK-NEXT: [[TMP1:%.*]] = select i1 [[DOTINV]], float 5.000000e+00, float [[A]]
9
9
; CHECK-NEXT: [[TMP2:%.*]] = fpext float [[TMP1]] to double
@@ -17,7 +17,7 @@ define double @t1(float %a) {
17
17
18
18
; Check this is converted into canonical form, as above.
19
19
define double @t2 (float %a ) {
20
- ; CHECK-LABEL: define {{[^@]+}} @t2(
20
+ ; CHECK-LABEL: @t2(
21
21
; CHECK-NEXT: [[DOTINV:%.*]] = fcmp oge float [[A:%.*]], 5.000000e+00
22
22
; CHECK-NEXT: [[TMP1:%.*]] = select i1 [[DOTINV]], float 5.000000e+00, float [[A]]
23
23
; CHECK-NEXT: [[TMP2:%.*]] = fpext float [[TMP1]] to double
@@ -31,7 +31,7 @@ define double @t2(float %a) {
31
31
32
32
; Same again, with trunc.
33
33
define float @t4 (double %a ) {
34
- ; CHECK-LABEL: define {{[^@]+}} @t4(
34
+ ; CHECK-LABEL: @t4(
35
35
; CHECK-NEXT: [[DOTINV:%.*]] = fcmp oge double [[A:%.*]], 5.000000e+00
36
36
; CHECK-NEXT: [[TMP1:%.*]] = select i1 [[DOTINV]], double 5.000000e+00, double [[A]]
37
37
; CHECK-NEXT: [[TMP2:%.*]] = fptrunc double [[TMP1]] to float
@@ -45,7 +45,7 @@ define float @t4(double %a) {
45
45
46
46
; different values, should not be converted.
47
47
define double @t5 (float %a ) {
48
- ; CHECK-LABEL: define {{[^@]+}} @t5(
48
+ ; CHECK-LABEL: @t5(
49
49
; CHECK-NEXT: [[TMP1:%.*]] = fcmp ult float [[A:%.*]], 5.000000e+00
50
50
; CHECK-NEXT: [[TMP2:%.*]] = fpext float [[A]] to double
51
51
; CHECK-NEXT: [[TMP3:%.*]] = select i1 [[TMP1]], double [[TMP2]], double 5.001000e+00
@@ -61,7 +61,7 @@ define double @t5(float %a) {
61
61
; So the compare constant may be treated as +0.0, and we sink the fpext.
62
62
63
63
define double @t6 (float %a ) {
64
- ; CHECK-LABEL: define {{[^@]+}} @t6(
64
+ ; CHECK-LABEL: @t6(
65
65
; CHECK-NEXT: [[DOTINV:%.*]] = fcmp oge float [[A:%.*]], 0.000000e+00
66
66
; CHECK-NEXT: [[TMP1:%.*]] = select i1 [[DOTINV]], float 0.000000e+00, float [[A]]
67
67
; CHECK-NEXT: [[TMP2:%.*]] = fpext float [[TMP1]] to double
@@ -77,7 +77,7 @@ define double @t6(float %a) {
77
77
; So the compare constant may be treated as -0.0, and we sink the fpext.
78
78
79
79
define double @t7 (float %a ) {
80
- ; CHECK-LABEL: define {{[^@]+}} @t7(
80
+ ; CHECK-LABEL: @t7(
81
81
; CHECK-NEXT: [[DOTINV:%.*]] = fcmp oge float [[A:%.*]], 0.000000e+00
82
82
; CHECK-NEXT: [[TMP1:%.*]] = select i1 [[DOTINV]], float -0.000000e+00, float [[A]]
83
83
; CHECK-NEXT: [[TMP2:%.*]] = fpext float [[TMP1]] to double
@@ -92,7 +92,7 @@ define double @t7(float %a) {
92
92
; min(min(x, 0.0), 0.0) --> min(x, 0.0)
93
93
94
94
define float @fmin_fmin_zero_mismatch (float %x ) {
95
- ; CHECK-LABEL: define {{[^@]+}} @fmin_fmin_zero_mismatch(
95
+ ; CHECK-LABEL: @fmin_fmin_zero_mismatch(
96
96
; CHECK-NEXT: [[TMP1:%.*]] = fcmp olt float [[X:%.*]], 0.000000e+00
97
97
; CHECK-NEXT: [[MIN2:%.*]] = select i1 [[TMP1]], float [[X]], float 0.000000e+00
98
98
; CHECK-NEXT: ret float [[MIN2]]
@@ -107,7 +107,7 @@ define float @fmin_fmin_zero_mismatch(float %x) {
107
107
; max(max(x, -0.0), -0.0) --> max(x, -0.0)
108
108
109
109
define float @fmax_fmax_zero_mismatch (float %x ) {
110
- ; CHECK-LABEL: define {{[^@]+}} @fmax_fmax_zero_mismatch(
110
+ ; CHECK-LABEL: @fmax_fmax_zero_mismatch(
111
111
; CHECK-NEXT: [[TMP1:%.*]] = fcmp ogt float [[X:%.*]], -0.000000e+00
112
112
; CHECK-NEXT: [[MAX11:%.*]] = select i1 [[TMP1]], float [[X]], float -0.000000e+00
113
113
; CHECK-NEXT: ret float [[MAX11]]
@@ -120,7 +120,7 @@ define float @fmax_fmax_zero_mismatch(float %x) {
120
120
}
121
121
122
122
define i64 @t8 (float %a ) {
123
- ; CHECK-LABEL: define {{[^@]+}} @t8(
123
+ ; CHECK-LABEL: @t8(
124
124
; CHECK-NEXT: [[DOTINV:%.*]] = fcmp oge float [[A:%.*]], 5.000000e+00
125
125
; CHECK-NEXT: [[TMP1:%.*]] = select i1 [[DOTINV]], float 5.000000e+00, float [[A]]
126
126
; CHECK-NEXT: [[TMP2:%.*]] = fptoui float [[TMP1]] to i64
@@ -133,7 +133,7 @@ define i64 @t8(float %a) {
133
133
}
134
134
135
135
define i8 @t9 (float %a ) {
136
- ; CHECK-LABEL: define {{[^@]+}} @t9(
136
+ ; CHECK-LABEL: @t9(
137
137
; CHECK-NEXT: [[DOTINV:%.*]] = fcmp oge float [[A:%.*]], 0.000000e+00
138
138
; CHECK-NEXT: [[TMP1:%.*]] = select i1 [[DOTINV]], float 0.000000e+00, float [[A]]
139
139
; CHECK-NEXT: [[TMP2:%.*]] = fptosi float [[TMP1]] to i8
@@ -147,7 +147,7 @@ define i8 @t9(float %a) {
147
147
148
148
; Either operand could be NaN, but fast modifier applied.
149
149
define i8 @t11 (float %a , float %b ) {
150
- ; CHECK-LABEL: define {{[^@]+}} @t11(
150
+ ; CHECK-LABEL: @t11(
151
151
; CHECK-NEXT: [[DOTINV:%.*]] = fcmp fast oge float [[B:%.*]], [[A:%.*]]
152
152
; CHECK-NEXT: [[TMP1:%.*]] = select fast i1 [[DOTINV]], float [[A]], float [[B]]
153
153
; CHECK-NEXT: [[TMP2:%.*]] = fptosi float [[TMP1]] to i8
@@ -162,7 +162,7 @@ define i8 @t11(float %a, float %b) {
162
162
163
163
; Either operand could be NaN, but nnan modifier applied.
164
164
define i8 @t12 (float %a , float %b ) {
165
- ; CHECK-LABEL: define {{[^@]+}} @t12(
165
+ ; CHECK-LABEL: @t12(
166
166
; CHECK-NEXT: [[DOTINV:%.*]] = fcmp nnan oge float [[B:%.*]], [[A:%.*]]
167
167
; CHECK-NEXT: [[TMP1:%.*]] = select nnan i1 [[DOTINV]], float [[A]], float [[B]]
168
168
; CHECK-NEXT: [[TMP2:%.*]] = fptosi float [[TMP1]] to i8
@@ -177,7 +177,7 @@ define i8 @t12(float %a, float %b) {
177
177
178
178
; Float and int values do not match.
179
179
define i8 @t13 (float %a ) {
180
- ; CHECK-LABEL: define {{[^@]+}} @t13(
180
+ ; CHECK-LABEL: @t13(
181
181
; CHECK-NEXT: [[TMP1:%.*]] = fcmp ult float [[A:%.*]], 1.500000e+00
182
182
; CHECK-NEXT: [[TMP2:%.*]] = fptosi float [[A]] to i8
183
183
; CHECK-NEXT: [[TMP3:%.*]] = select i1 [[TMP1]], i8 [[TMP2]], i8 1
@@ -191,7 +191,7 @@ define i8 @t13(float %a) {
191
191
192
192
; %a could be -0.0, but it doesn't matter because the conversion to int is the same for 0.0 or -0.0.
193
193
define i8 @t14 (float %a ) {
194
- ; CHECK-LABEL: define {{[^@]+}} @t14(
194
+ ; CHECK-LABEL: @t14(
195
195
; CHECK-NEXT: [[DOTINV:%.*]] = fcmp oge float [[A:%.*]], 0.000000e+00
196
196
; CHECK-NEXT: [[TMP1:%.*]] = select i1 [[DOTINV]], float 0.000000e+00, float [[A]]
197
197
; CHECK-NEXT: [[TMP2:%.*]] = fptosi float [[TMP1]] to i8
@@ -204,7 +204,7 @@ define i8 @t14(float %a) {
204
204
}
205
205
206
206
define i8 @t14_commute (float %a ) {
207
- ; CHECK-LABEL: define {{[^@]+}} @t14_commute(
207
+ ; CHECK-LABEL: @t14_commute(
208
208
; CHECK-NEXT: [[TMP1:%.*]] = fcmp ogt float [[A:%.*]], 0.000000e+00
209
209
; CHECK-NEXT: [[TMP2:%.*]] = select i1 [[TMP1]], float [[A]], float 0.000000e+00
210
210
; CHECK-NEXT: [[TMP3:%.*]] = fptosi float [[TMP2]] to i8
@@ -217,7 +217,7 @@ define i8 @t14_commute(float %a) {
217
217
}
218
218
219
219
define i8 @t15 (float %a ) {
220
- ; CHECK-LABEL: define {{[^@]+}} @t15(
220
+ ; CHECK-LABEL: @t15(
221
221
; CHECK-NEXT: [[DOTINV:%.*]] = fcmp nsz oge float [[A:%.*]], 0.000000e+00
222
222
; CHECK-NEXT: [[TMP1:%.*]] = select nsz i1 [[DOTINV]], float 0.000000e+00, float [[A]]
223
223
; CHECK-NEXT: [[TMP2:%.*]] = fptosi float [[TMP1]] to i8
@@ -230,7 +230,7 @@ define i8 @t15(float %a) {
230
230
}
231
231
232
232
define double @t16 (i32 %x ) {
233
- ; CHECK-LABEL: define {{[^@]+}} @t16(
233
+ ; CHECK-LABEL: @t16(
234
234
; CHECK-NEXT: [[CMP:%.*]] = icmp sgt i32 [[X:%.*]], 0
235
235
; CHECK-NEXT: [[CST:%.*]] = sitofp i32 [[X]] to double
236
236
; CHECK-NEXT: [[SEL:%.*]] = select i1 [[CMP]], double [[CST]], double 5.000000e-01
@@ -243,7 +243,7 @@ define double @t16(i32 %x) {
243
243
}
244
244
245
245
define double @t17 (i32 %x ) {
246
- ; CHECK-LABEL: define {{[^@]+}} @t17(
246
+ ; CHECK-LABEL: @t17(
247
247
; CHECK-NEXT: [[TMP1:%.*]] = icmp sgt i32 [[X:%.*]], 2
248
248
; CHECK-NEXT: [[SEL1:%.*]] = select i1 [[TMP1]], i32 [[X]], i32 2
249
249
; CHECK-NEXT: [[TMP2:%.*]] = sitofp i32 [[SEL1]] to double
@@ -256,7 +256,7 @@ define double @t17(i32 %x) {
256
256
}
257
257
258
258
define float @fneg_fmax (float %x , float %y ) {
259
- ; CHECK-LABEL: define {{[^@]+}} @fneg_fmax(
259
+ ; CHECK-LABEL: @fneg_fmax(
260
260
; CHECK-NEXT: [[COND:%.*]] = fcmp nnan olt float [[X:%.*]], [[Y:%.*]]
261
261
; CHECK-NEXT: [[MAX_V:%.*]] = select i1 [[COND]], float [[X]], float [[Y]]
262
262
; CHECK-NEXT: [[MAX:%.*]] = fneg float [[MAX_V]]
@@ -270,7 +270,7 @@ define float @fneg_fmax(float %x, float %y) {
270
270
}
271
271
272
272
define <2 x float > @fsub_fmax (<2 x float > %x , <2 x float > %y ) {
273
- ; CHECK-LABEL: define {{[^@]+}} @fsub_fmax(
273
+ ; CHECK-LABEL: @fsub_fmax(
274
274
; CHECK-NEXT: [[COND_INV:%.*]] = fcmp nnan nsz ogt <2 x float> [[X:%.*]], [[Y:%.*]]
275
275
; CHECK-NEXT: [[TMP1:%.*]] = select nnan nsz <2 x i1> [[COND_INV]], <2 x float> [[Y]], <2 x float> [[X]]
276
276
; CHECK-NEXT: [[MAX:%.*]] = fneg <2 x float> [[TMP1]]
@@ -284,7 +284,7 @@ define <2 x float> @fsub_fmax(<2 x float> %x, <2 x float> %y) {
284
284
}
285
285
286
286
define <2 x double > @fsub_fmin (<2 x double > %x , <2 x double > %y ) {
287
- ; CHECK-LABEL: define {{[^@]+}} @fsub_fmin(
287
+ ; CHECK-LABEL: @fsub_fmin(
288
288
; CHECK-NEXT: [[COND:%.*]] = fcmp nnan ogt <2 x double> [[X:%.*]], [[Y:%.*]]
289
289
; CHECK-NEXT: [[MAX_V:%.*]] = select <2 x i1> [[COND]], <2 x double> [[X]], <2 x double> [[Y]]
290
290
; CHECK-NEXT: [[MAX:%.*]] = fneg <2 x double> [[MAX_V]]
@@ -298,7 +298,7 @@ define <2 x double> @fsub_fmin(<2 x double> %x, <2 x double> %y) {
298
298
}
299
299
300
300
define double @fneg_fmin (double %x , double %y ) {
301
- ; CHECK-LABEL: define {{[^@]+}} @fneg_fmin(
301
+ ; CHECK-LABEL: @fneg_fmin(
302
302
; CHECK-NEXT: [[COND_INV:%.*]] = fcmp nnan nsz olt double [[X:%.*]], [[Y:%.*]]
303
303
; CHECK-NEXT: [[TMP1:%.*]] = select nnan nsz i1 [[COND_INV]], double [[Y]], double [[X]]
304
304
; CHECK-NEXT: [[MAX:%.*]] = fneg double [[TMP1]]
@@ -312,7 +312,7 @@ define double @fneg_fmin(double %x, double %y) {
312
312
}
313
313
314
314
define float @maxnum_ogt_fmf_on_select (float %a , float %b ) {
315
- ; CHECK-LABEL: define {{[^@]+}} @maxnum_ogt_fmf_on_select(
315
+ ; CHECK-LABEL: @maxnum_ogt_fmf_on_select(
316
316
; CHECK-NEXT: [[TMP1:%.*]] = call nnan nsz float @llvm.maxnum.f32(float [[A:%.*]], float [[B:%.*]])
317
317
; CHECK-NEXT: ret float [[TMP1]]
318
318
;
@@ -322,7 +322,7 @@ define float @maxnum_ogt_fmf_on_select(float %a, float %b) {
322
322
}
323
323
324
324
define <2 x float > @maxnum_oge_fmf_on_select (<2 x float > %a , <2 x float > %b ) {
325
- ; CHECK-LABEL: define {{[^@]+}} @maxnum_oge_fmf_on_select(
325
+ ; CHECK-LABEL: @maxnum_oge_fmf_on_select(
326
326
; CHECK-NEXT: [[TMP1:%.*]] = call nnan ninf nsz <2 x float> @llvm.maxnum.v2f32(<2 x float> [[A:%.*]], <2 x float> [[B:%.*]])
327
327
; CHECK-NEXT: ret <2 x float> [[TMP1]]
328
328
;
@@ -332,7 +332,7 @@ define <2 x float> @maxnum_oge_fmf_on_select(<2 x float> %a, <2 x float> %b) {
332
332
}
333
333
334
334
define float @maxnum_ogt_fmf_on_fcmp (float %a , float %b ) {
335
- ; CHECK-LABEL: define {{[^@]+}} @maxnum_ogt_fmf_on_fcmp(
335
+ ; CHECK-LABEL: @maxnum_ogt_fmf_on_fcmp(
336
336
; CHECK-NEXT: [[COND:%.*]] = fcmp nnan nsz ogt float [[A:%.*]], [[B:%.*]]
337
337
; CHECK-NEXT: [[F:%.*]] = select i1 [[COND]], float [[A]], float [[B]]
338
338
; CHECK-NEXT: ret float [[F]]
@@ -343,7 +343,7 @@ define float @maxnum_ogt_fmf_on_fcmp(float %a, float %b) {
343
343
}
344
344
345
345
define <2 x float > @maxnum_oge_fmf_on_fcmp (<2 x float > %a , <2 x float > %b ) {
346
- ; CHECK-LABEL: define {{[^@]+}} @maxnum_oge_fmf_on_fcmp(
346
+ ; CHECK-LABEL: @maxnum_oge_fmf_on_fcmp(
347
347
; CHECK-NEXT: [[COND:%.*]] = fcmp nnan ninf nsz oge <2 x float> [[A:%.*]], [[B:%.*]]
348
348
; CHECK-NEXT: [[F:%.*]] = select <2 x i1> [[COND]], <2 x float> [[A]], <2 x float> [[B]]
349
349
; CHECK-NEXT: ret <2 x float> [[F]]
@@ -354,7 +354,7 @@ define <2 x float> @maxnum_oge_fmf_on_fcmp(<2 x float> %a, <2 x float> %b) {
354
354
}
355
355
356
356
define float @maxnum_no_nsz (float %a , float %b ) {
357
- ; CHECK-LABEL: define {{[^@]+}} @maxnum_no_nsz(
357
+ ; CHECK-LABEL: @maxnum_no_nsz(
358
358
; CHECK-NEXT: [[COND:%.*]] = fcmp ogt float [[A:%.*]], [[B:%.*]]
359
359
; CHECK-NEXT: [[F:%.*]] = select nnan i1 [[COND]], float [[A]], float [[B]]
360
360
; CHECK-NEXT: ret float [[F]]
@@ -365,7 +365,7 @@ define float @maxnum_no_nsz(float %a, float %b) {
365
365
}
366
366
367
367
define float @maxnum_no_nnan (float %a , float %b ) {
368
- ; CHECK-LABEL: define {{[^@]+}} @maxnum_no_nnan(
368
+ ; CHECK-LABEL: @maxnum_no_nnan(
369
369
; CHECK-NEXT: [[COND:%.*]] = fcmp oge float [[A:%.*]], [[B:%.*]]
370
370
; CHECK-NEXT: [[F:%.*]] = select nsz i1 [[COND]], float [[A]], float [[B]]
371
371
; CHECK-NEXT: ret float [[F]]
@@ -376,7 +376,7 @@ define float @maxnum_no_nnan(float %a, float %b) {
376
376
}
377
377
378
378
define float @minnum_olt_fmf_on_select (float %a , float %b ) {
379
- ; CHECK-LABEL: define {{[^@]+}} @minnum_olt_fmf_on_select(
379
+ ; CHECK-LABEL: @minnum_olt_fmf_on_select(
380
380
; CHECK-NEXT: [[TMP1:%.*]] = call nnan nsz float @llvm.minnum.f32(float [[A:%.*]], float [[B:%.*]])
381
381
; CHECK-NEXT: ret float [[TMP1]]
382
382
;
@@ -386,7 +386,7 @@ define float @minnum_olt_fmf_on_select(float %a, float %b) {
386
386
}
387
387
388
388
define <2 x float > @minnum_ole_fmf_on_select (<2 x float > %a , <2 x float > %b ) {
389
- ; CHECK-LABEL: define {{[^@]+}} @minnum_ole_fmf_on_select(
389
+ ; CHECK-LABEL: @minnum_ole_fmf_on_select(
390
390
; CHECK-NEXT: [[TMP1:%.*]] = call nnan ninf nsz <2 x float> @llvm.minnum.v2f32(<2 x float> [[A:%.*]], <2 x float> [[B:%.*]])
391
391
; CHECK-NEXT: ret <2 x float> [[TMP1]]
392
392
;
@@ -396,7 +396,7 @@ define <2 x float> @minnum_ole_fmf_on_select(<2 x float> %a, <2 x float> %b) {
396
396
}
397
397
398
398
define float @minnum_olt_fmf_on_fcmp (float %a , float %b ) {
399
- ; CHECK-LABEL: define {{[^@]+}} @minnum_olt_fmf_on_fcmp(
399
+ ; CHECK-LABEL: @minnum_olt_fmf_on_fcmp(
400
400
; CHECK-NEXT: [[COND:%.*]] = fcmp nnan nsz olt float [[A:%.*]], [[B:%.*]]
401
401
; CHECK-NEXT: [[F:%.*]] = select i1 [[COND]], float [[A]], float [[B]]
402
402
; CHECK-NEXT: ret float [[F]]
@@ -407,7 +407,7 @@ define float @minnum_olt_fmf_on_fcmp(float %a, float %b) {
407
407
}
408
408
409
409
define <2 x float > @minnum_ole_fmf_on_fcmp (<2 x float > %a , <2 x float > %b ) {
410
- ; CHECK-LABEL: define {{[^@]+}} @minnum_ole_fmf_on_fcmp(
410
+ ; CHECK-LABEL: @minnum_ole_fmf_on_fcmp(
411
411
; CHECK-NEXT: [[COND:%.*]] = fcmp nnan ninf nsz ole <2 x float> [[A:%.*]], [[B:%.*]]
412
412
; CHECK-NEXT: [[F:%.*]] = select <2 x i1> [[COND]], <2 x float> [[A]], <2 x float> [[B]]
413
413
; CHECK-NEXT: ret <2 x float> [[F]]
@@ -418,7 +418,7 @@ define <2 x float> @minnum_ole_fmf_on_fcmp(<2 x float> %a, <2 x float> %b) {
418
418
}
419
419
420
420
define float @minnum_no_nsz (float %a , float %b ) {
421
- ; CHECK-LABEL: define {{[^@]+}} @minnum_no_nsz(
421
+ ; CHECK-LABEL: @minnum_no_nsz(
422
422
; CHECK-NEXT: [[COND:%.*]] = fcmp olt float [[A:%.*]], [[B:%.*]]
423
423
; CHECK-NEXT: [[F:%.*]] = select nnan i1 [[COND]], float [[A]], float [[B]]
424
424
; CHECK-NEXT: ret float [[F]]
@@ -429,7 +429,7 @@ define float @minnum_no_nsz(float %a, float %b) {
429
429
}
430
430
431
431
define float @minnum_no_nnan (float %a , float %b ) {
432
- ; CHECK-LABEL: define {{[^@]+}} @minnum_no_nnan(
432
+ ; CHECK-LABEL: @minnum_no_nnan(
433
433
; CHECK-NEXT: [[COND:%.*]] = fcmp ole float [[A:%.*]], [[B:%.*]]
434
434
; CHECK-NEXT: [[F:%.*]] = select nsz i1 [[COND]], float [[A]], float [[B]]
435
435
; CHECK-NEXT: ret float [[F]]
0 commit comments