1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt -S -passes=instcombine < %s | FileCheck %s
4 declare float @llvm.minnum.f32(float, float)
5 declare <2 x float> @llvm.minnum.v2f32(<2 x float>, <2 x float>)
6 declare <4 x float> @llvm.minnum.v4f32(<4 x float>, <4 x float>)
8 declare double @llvm.minnum.f64(double, double)
9 declare <2 x double> @llvm.minnum.v2f64(<2 x double>, <2 x double>)
11 declare float @llvm.maxnum.f32(float, float)
13 define float @constant_fold_minnum_f32() {
14 ; CHECK-LABEL: @constant_fold_minnum_f32(
15 ; CHECK-NEXT: ret float 1.000000e+00
17 %x = call float @llvm.minnum.f32(float 1.0, float 2.0)
21 define float @constant_fold_minnum_f32_inv() {
22 ; CHECK-LABEL: @constant_fold_minnum_f32_inv(
23 ; CHECK-NEXT: ret float 1.000000e+00
25 %x = call float @llvm.minnum.f32(float 2.0, float 1.0)
29 define float @constant_fold_minnum_f32_nan0() {
30 ; CHECK-LABEL: @constant_fold_minnum_f32_nan0(
31 ; CHECK-NEXT: ret float 2.000000e+00
33 %x = call float @llvm.minnum.f32(float 0x7FF8000000000000, float 2.0)
37 define float @constant_fold_minnum_f32_nan1() {
38 ; CHECK-LABEL: @constant_fold_minnum_f32_nan1(
39 ; CHECK-NEXT: ret float 2.000000e+00
41 %x = call float @llvm.minnum.f32(float 2.0, float 0x7FF8000000000000)
45 define float @constant_fold_minnum_f32_nan_nan() {
46 ; CHECK-LABEL: @constant_fold_minnum_f32_nan_nan(
47 ; CHECK-NEXT: ret float 0x7FF8000000000000
49 %x = call float @llvm.minnum.f32(float 0x7FF8000000000000, float 0x7FF8000000000000)
53 define float @constant_fold_minnum_f32_p0_p0() {
54 ; CHECK-LABEL: @constant_fold_minnum_f32_p0_p0(
55 ; CHECK-NEXT: ret float 0.000000e+00
57 %x = call float @llvm.minnum.f32(float 0.0, float 0.0)
61 define float @constant_fold_minnum_f32_p0_n0() {
62 ; CHECK-LABEL: @constant_fold_minnum_f32_p0_n0(
63 ; CHECK-NEXT: ret float -0.000000e+00
65 %x = call float @llvm.minnum.f32(float 0.0, float -0.0)
69 define float @constant_fold_minnum_f32_n0_p0() {
70 ; CHECK-LABEL: @constant_fold_minnum_f32_n0_p0(
71 ; CHECK-NEXT: ret float -0.000000e+00
73 %x = call float @llvm.minnum.f32(float -0.0, float 0.0)
77 define float @constant_fold_minnum_f32_n0_n0() {
78 ; CHECK-LABEL: @constant_fold_minnum_f32_n0_n0(
79 ; CHECK-NEXT: ret float -0.000000e+00
81 %x = call float @llvm.minnum.f32(float -0.0, float -0.0)
85 define <4 x float> @constant_fold_minnum_v4f32() {
86 ; CHECK-LABEL: @constant_fold_minnum_v4f32(
87 ; CHECK-NEXT: ret <4 x float> <float 1.000000e+00, float 2.000000e+00, float 3.000000e+00, float 5.000000e+00>
89 %x = call <4 x float> @llvm.minnum.v4f32(<4 x float> <float 1.0, float 8.0, float 3.0, float 9.0>, <4 x float> <float 2.0, float 2.0, float 10.0, float 5.0>)
93 define double @constant_fold_minnum_f64() {
94 ; CHECK-LABEL: @constant_fold_minnum_f64(
95 ; CHECK-NEXT: ret double 1.000000e+00
97 %x = call double @llvm.minnum.f64(double 1.0, double 2.0)
101 define double @constant_fold_minnum_f64_nan0() {
102 ; CHECK-LABEL: @constant_fold_minnum_f64_nan0(
103 ; CHECK-NEXT: ret double 2.000000e+00
105 %x = call double @llvm.minnum.f64(double 0x7FF8000000000000, double 2.0)
109 define double @constant_fold_minnum_f64_nan1() {
110 ; CHECK-LABEL: @constant_fold_minnum_f64_nan1(
111 ; CHECK-NEXT: ret double 2.000000e+00
113 %x = call double @llvm.minnum.f64(double 2.0, double 0x7FF8000000000000)
117 define double @constant_fold_minnum_f64_nan_nan() {
118 ; CHECK-LABEL: @constant_fold_minnum_f64_nan_nan(
119 ; CHECK-NEXT: ret double 0x7FF8000000000000
121 %x = call double @llvm.minnum.f64(double 0x7FF8000000000000, double 0x7FF8000000000000)
125 define float @canonicalize_constant_minnum_f32(float %x) {
126 ; CHECK-LABEL: @canonicalize_constant_minnum_f32(
127 ; CHECK-NEXT: [[Y:%.*]] = call float @llvm.minnum.f32(float [[X:%.*]], float 1.000000e+00)
128 ; CHECK-NEXT: ret float [[Y]]
130 %y = call float @llvm.minnum.f32(float 1.0, float %x)
134 define float @minnum_f32_nan_val(float %x) {
135 ; CHECK-LABEL: @minnum_f32_nan_val(
136 ; CHECK-NEXT: ret float [[X:%.*]]
138 %y = call float @llvm.minnum.f32(float 0x7FF8000000000000, float %x)
142 define float @minnum_f32_val_nan(float %x) {
143 ; CHECK-LABEL: @minnum_f32_val_nan(
144 ; CHECK-NEXT: ret float [[X:%.*]]
146 %y = call float @llvm.minnum.f32(float %x, float 0x7FF8000000000000)
150 define float @minnum_f32_1_minnum_val_p0(float %x) {
151 ; CHECK-LABEL: @minnum_f32_1_minnum_val_p0(
152 ; CHECK-NEXT: [[Z:%.*]] = call float @llvm.minnum.f32(float [[X:%.*]], float 0.000000e+00)
153 ; CHECK-NEXT: ret float [[Z]]
155 %y = call float @llvm.minnum.f32(float %x, float 0.0)
156 %z = call float @llvm.minnum.f32(float %y, float 1.0)
160 define float @minnum_f32_1_minnum_p0_val_fast(float %x) {
161 ; CHECK-LABEL: @minnum_f32_1_minnum_p0_val_fast(
162 ; CHECK-NEXT: [[Z:%.*]] = call float @llvm.minnum.f32(float [[X:%.*]], float 0.000000e+00)
163 ; CHECK-NEXT: ret float [[Z]]
165 %y = call float @llvm.minnum.f32(float 0.0, float %x)
166 %z = call fast float @llvm.minnum.f32(float %y, float 1.0)
170 define float @minnum_f32_1_minnum_p0_val_fmf1(float %x) {
171 ; CHECK-LABEL: @minnum_f32_1_minnum_p0_val_fmf1(
172 ; CHECK-NEXT: [[Z:%.*]] = call nnan float @llvm.minnum.f32(float [[X:%.*]], float 0.000000e+00)
173 ; CHECK-NEXT: ret float [[Z]]
175 %y = call nsz nnan float @llvm.minnum.f32(float 0.0, float %x)
176 %z = call nnan ninf float @llvm.minnum.f32(float %y, float 1.0)
180 define float @minnum_f32_1_minnum_p0_val_fmf2(float %x) {
181 ; CHECK-LABEL: @minnum_f32_1_minnum_p0_val_fmf2(
182 ; CHECK-NEXT: [[Z:%.*]] = call ninf float @llvm.minnum.f32(float [[X:%.*]], float 0.000000e+00)
183 ; CHECK-NEXT: ret float [[Z]]
185 %y = call nnan ninf float @llvm.minnum.f32(float 0.0, float %x)
186 %z = call nsz ninf float @llvm.minnum.f32(float %y, float 1.0)
190 define float @minnum_f32_1_minnum_p0_val_fmf3(float %x) {
191 ; CHECK-LABEL: @minnum_f32_1_minnum_p0_val_fmf3(
192 ; CHECK-NEXT: [[Z:%.*]] = call nnan ninf nsz float @llvm.minnum.f32(float [[X:%.*]], float 0.000000e+00)
193 ; CHECK-NEXT: ret float [[Z]]
195 %y = call nsz ninf nnan float @llvm.minnum.f32(float 0.0, float %x)
196 %z = call nsz ninf nnan float @llvm.minnum.f32(float %y, float 1.0)
200 define float @minnum_f32_p0_minnum_val_n0(float %x) {
201 ; CHECK-LABEL: @minnum_f32_p0_minnum_val_n0(
202 ; CHECK-NEXT: [[Z:%.*]] = call float @llvm.minnum.f32(float [[X:%.*]], float -0.000000e+00)
203 ; CHECK-NEXT: ret float [[Z]]
205 %y = call float @llvm.minnum.f32(float %x, float -0.0)
206 %z = call float @llvm.minnum.f32(float %y, float 0.0)
210 define float @minnum_f32_1_minnum_p0_val(float %x) {
211 ; CHECK-LABEL: @minnum_f32_1_minnum_p0_val(
212 ; CHECK-NEXT: [[Z:%.*]] = call float @llvm.minnum.f32(float [[X:%.*]], float 0.000000e+00)
213 ; CHECK-NEXT: ret float [[Z]]
215 %y = call float @llvm.minnum.f32(float 0.0, float %x)
216 %z = call float @llvm.minnum.f32(float %y, float 1.0)
220 define <2 x float> @minnum_f32_1_minnum_val_p0_val_v2f32(<2 x float> %x) {
221 ; CHECK-LABEL: @minnum_f32_1_minnum_val_p0_val_v2f32(
222 ; CHECK-NEXT: [[Z:%.*]] = call <2 x float> @llvm.minnum.v2f32(<2 x float> [[X:%.*]], <2 x float> zeroinitializer)
223 ; CHECK-NEXT: ret <2 x float> [[Z]]
225 %y = call <2 x float> @llvm.minnum.v2f32(<2 x float> %x, <2 x float> zeroinitializer)
226 %z = call <2 x float> @llvm.minnum.v2f32(<2 x float> %y, <2 x float><float 1.0, float 1.0>)
230 define float @minnum4(float %x, float %y, float %z, float %w) {
231 ; CHECK-LABEL: @minnum4(
232 ; CHECK-NEXT: [[A:%.*]] = call float @llvm.minnum.f32(float [[X:%.*]], float [[Y:%.*]])
233 ; CHECK-NEXT: [[B:%.*]] = call float @llvm.minnum.f32(float [[Z:%.*]], float [[W:%.*]])
234 ; CHECK-NEXT: [[C:%.*]] = call float @llvm.minnum.f32(float [[A]], float [[B]])
235 ; CHECK-NEXT: ret float [[C]]
237 %a = call float @llvm.minnum.f32(float %x, float %y)
238 %b = call float @llvm.minnum.f32(float %z, float %w)
239 %c = call float @llvm.minnum.f32(float %a, float %b)
243 define float @minnum_x_maxnum_x_y(float %x, float %y) {
244 ; CHECK-LABEL: @minnum_x_maxnum_x_y(
245 ; CHECK-NEXT: [[A:%.*]] = call float @llvm.maxnum.f32(float [[X:%.*]], float [[Y:%.*]])
246 ; CHECK-NEXT: [[B:%.*]] = call float @llvm.minnum.f32(float [[X]], float [[A]])
247 ; CHECK-NEXT: ret float [[B]]
249 %a = call float @llvm.maxnum.f32(float %x, float %y)
250 %b = call float @llvm.minnum.f32(float %x, float %a)
254 define float @maxnum_x_minnum_x_y(float %x, float %y) {
255 ; CHECK-LABEL: @maxnum_x_minnum_x_y(
256 ; CHECK-NEXT: [[A:%.*]] = call float @llvm.minnum.f32(float [[X:%.*]], float [[Y:%.*]])
257 ; CHECK-NEXT: [[B:%.*]] = call float @llvm.maxnum.f32(float [[X]], float [[A]])
258 ; CHECK-NEXT: ret float [[B]]
260 %a = call float @llvm.minnum.f32(float %x, float %y)
261 %b = call float @llvm.maxnum.f32(float %x, float %a)
265 ; PR37405 - https://bugs.llvm.org/show_bug.cgi?id=37405
267 define double @neg_neg(double %x, double %y) {
268 ; CHECK-LABEL: @neg_neg(
269 ; CHECK-NEXT: [[TMP1:%.*]] = call double @llvm.maxnum.f64(double [[X:%.*]], double [[Y:%.*]])
270 ; CHECK-NEXT: [[R:%.*]] = fneg double [[TMP1]]
271 ; CHECK-NEXT: ret double [[R]]
273 %negx = fsub double -0.0, %x
274 %negy = fsub double -0.0, %y
275 %r = call double @llvm.minnum.f64(double %negx, double %negy)
279 define double @unary_neg_neg(double %x, double %y) {
280 ; CHECK-LABEL: @unary_neg_neg(
281 ; CHECK-NEXT: [[TMP1:%.*]] = call double @llvm.maxnum.f64(double [[X:%.*]], double [[Y:%.*]])
282 ; CHECK-NEXT: [[R:%.*]] = fneg double [[TMP1]]
283 ; CHECK-NEXT: ret double [[R]]
285 %negx = fneg double %x
286 %negy = fneg double %y
287 %r = call double @llvm.minnum.f64(double %negx, double %negy)
291 ; FMF is not required, but it should be propagated from the intrinsic (not the fnegs).
292 ; Also, make sure this works with vectors.
294 define <2 x double> @neg_neg_vec_fmf(<2 x double> %x, <2 x double> %y) {
295 ; CHECK-LABEL: @neg_neg_vec_fmf(
296 ; CHECK-NEXT: [[TMP1:%.*]] = call nnan ninf <2 x double> @llvm.maxnum.v2f64(<2 x double> [[X:%.*]], <2 x double> [[Y:%.*]])
297 ; CHECK-NEXT: [[R:%.*]] = fneg nnan ninf <2 x double> [[TMP1]]
298 ; CHECK-NEXT: ret <2 x double> [[R]]
300 %negx = fsub reassoc <2 x double> <double -0.0, double -0.0>, %x
301 %negy = fsub fast <2 x double> <double -0.0, double -0.0>, %y
302 %r = call nnan ninf <2 x double> @llvm.minnum.v2f64(<2 x double> %negx, <2 x double> %negy)
306 define <2 x double> @unary_neg_neg_vec_fmf(<2 x double> %x, <2 x double> %y) {
307 ; CHECK-LABEL: @unary_neg_neg_vec_fmf(
308 ; CHECK-NEXT: [[TMP1:%.*]] = call nnan ninf <2 x double> @llvm.maxnum.v2f64(<2 x double> [[X:%.*]], <2 x double> [[Y:%.*]])
309 ; CHECK-NEXT: [[R:%.*]] = fneg nnan ninf <2 x double> [[TMP1]]
310 ; CHECK-NEXT: ret <2 x double> [[R]]
312 %negx = fneg reassoc <2 x double> %x
313 %negy = fneg fast <2 x double> %y
314 %r = call nnan ninf <2 x double> @llvm.minnum.v2f64(<2 x double> %negx, <2 x double> %negy)
318 ; 1 extra use of an intermediate value should still allow the fold,
319 ; but 2 would require more instructions than we started with.
321 declare void @use(double)
322 define double @neg_neg_extra_use_x(double %x, double %y) {
323 ; CHECK-LABEL: @neg_neg_extra_use_x(
324 ; CHECK-NEXT: [[NEGX:%.*]] = fneg double [[X:%.*]]
325 ; CHECK-NEXT: [[TMP1:%.*]] = call double @llvm.maxnum.f64(double [[X]], double [[Y:%.*]])
326 ; CHECK-NEXT: [[R:%.*]] = fneg double [[TMP1]]
327 ; CHECK-NEXT: call void @use(double [[NEGX]])
328 ; CHECK-NEXT: ret double [[R]]
330 %negx = fsub double -0.0, %x
331 %negy = fsub double -0.0, %y
332 %r = call double @llvm.minnum.f64(double %negx, double %negy)
333 call void @use(double %negx)
337 define double @unary_neg_neg_extra_use_x(double %x, double %y) {
338 ; CHECK-LABEL: @unary_neg_neg_extra_use_x(
339 ; CHECK-NEXT: [[NEGX:%.*]] = fneg double [[X:%.*]]
340 ; CHECK-NEXT: [[TMP1:%.*]] = call double @llvm.maxnum.f64(double [[X]], double [[Y:%.*]])
341 ; CHECK-NEXT: [[R:%.*]] = fneg double [[TMP1]]
342 ; CHECK-NEXT: call void @use(double [[NEGX]])
343 ; CHECK-NEXT: ret double [[R]]
345 %negx = fneg double %x
346 %negy = fneg double %y
347 %r = call double @llvm.minnum.f64(double %negx, double %negy)
348 call void @use(double %negx)
352 define double @neg_neg_extra_use_y(double %x, double %y) {
353 ; CHECK-LABEL: @neg_neg_extra_use_y(
354 ; CHECK-NEXT: [[NEGY:%.*]] = fneg double [[Y:%.*]]
355 ; CHECK-NEXT: [[TMP1:%.*]] = call double @llvm.maxnum.f64(double [[X:%.*]], double [[Y]])
356 ; CHECK-NEXT: [[R:%.*]] = fneg double [[TMP1]]
357 ; CHECK-NEXT: call void @use(double [[NEGY]])
358 ; CHECK-NEXT: ret double [[R]]
360 %negx = fsub double -0.0, %x
361 %negy = fsub double -0.0, %y
362 %r = call double @llvm.minnum.f64(double %negx, double %negy)
363 call void @use(double %negy)
367 define double @unary_neg_neg_extra_use_y(double %x, double %y) {
368 ; CHECK-LABEL: @unary_neg_neg_extra_use_y(
369 ; CHECK-NEXT: [[NEGY:%.*]] = fneg double [[Y:%.*]]
370 ; CHECK-NEXT: [[TMP1:%.*]] = call double @llvm.maxnum.f64(double [[X:%.*]], double [[Y]])
371 ; CHECK-NEXT: [[R:%.*]] = fneg double [[TMP1]]
372 ; CHECK-NEXT: call void @use(double [[NEGY]])
373 ; CHECK-NEXT: ret double [[R]]
375 %negx = fneg double %x
376 %negy = fneg double %y
377 %r = call double @llvm.minnum.f64(double %negx, double %negy)
378 call void @use(double %negy)
382 define double @neg_neg_extra_use_x_and_y(double %x, double %y) {
383 ; CHECK-LABEL: @neg_neg_extra_use_x_and_y(
384 ; CHECK-NEXT: [[NEGX:%.*]] = fneg double [[X:%.*]]
385 ; CHECK-NEXT: [[NEGY:%.*]] = fneg double [[Y:%.*]]
386 ; CHECK-NEXT: [[R:%.*]] = call double @llvm.minnum.f64(double [[NEGX]], double [[NEGY]])
387 ; CHECK-NEXT: call void @use(double [[NEGX]])
388 ; CHECK-NEXT: call void @use(double [[NEGY]])
389 ; CHECK-NEXT: ret double [[R]]
391 %negx = fsub double -0.0, %x
392 %negy = fsub double -0.0, %y
393 %r = call double @llvm.minnum.f64(double %negx, double %negy)
394 call void @use(double %negx)
395 call void @use(double %negy)
399 define double @unary_neg_neg_extra_use_x_and_y(double %x, double %y) {
400 ; CHECK-LABEL: @unary_neg_neg_extra_use_x_and_y(
401 ; CHECK-NEXT: [[NEGX:%.*]] = fneg double [[X:%.*]]
402 ; CHECK-NEXT: [[NEGY:%.*]] = fneg double [[Y:%.*]]
403 ; CHECK-NEXT: [[R:%.*]] = call double @llvm.minnum.f64(double [[NEGX]], double [[NEGY]])
404 ; CHECK-NEXT: call void @use(double [[NEGX]])
405 ; CHECK-NEXT: call void @use(double [[NEGY]])
406 ; CHECK-NEXT: ret double [[R]]
408 %negx = fneg double %x
409 %negy = fneg double %y
410 %r = call double @llvm.minnum.f64(double %negx, double %negy)
411 call void @use(double %negx)
412 call void @use(double %negy)
416 define float @reduce_precision(float %x, float %y) {
417 ; CHECK-LABEL: @reduce_precision(
418 ; CHECK-NEXT: [[MINNUM1:%.*]] = call float @llvm.minnum.f32(float [[X:%.*]], float [[Y:%.*]])
419 ; CHECK-NEXT: ret float [[MINNUM1]]
421 %x.ext = fpext float %x to double
422 %y.ext = fpext float %y to double
423 %minnum = call double @llvm.minnum.f64(double %x.ext, double %y.ext)
424 %trunc = fptrunc double %minnum to float
428 define float @reduce_precision_fmf(float %x, float %y) {
429 ; CHECK-LABEL: @reduce_precision_fmf(
430 ; CHECK-NEXT: [[MINNUM1:%.*]] = call nnan float @llvm.minnum.f32(float [[X:%.*]], float [[Y:%.*]])
431 ; CHECK-NEXT: ret float [[MINNUM1]]
433 %x.ext = fpext float %x to double
434 %y.ext = fpext float %y to double
435 %minnum = call nnan double @llvm.minnum.f64(double %x.ext, double %y.ext)
436 %trunc = fptrunc double %minnum to float
440 define float @reduce_precision_multi_use_0(float %x, float %y, ptr %p) {
441 ; CHECK-LABEL: @reduce_precision_multi_use_0(
442 ; CHECK-NEXT: [[X_EXT:%.*]] = fpext float [[X:%.*]] to double
443 ; CHECK-NEXT: [[Y_EXT:%.*]] = fpext float [[Y:%.*]] to double
444 ; CHECK-NEXT: store double [[X_EXT]], ptr [[P:%.*]], align 8
445 ; CHECK-NEXT: [[MINNUM:%.*]] = call double @llvm.minnum.f64(double [[X_EXT]], double [[Y_EXT]])
446 ; CHECK-NEXT: [[TRUNC:%.*]] = fptrunc double [[MINNUM]] to float
447 ; CHECK-NEXT: ret float [[TRUNC]]
449 %x.ext = fpext float %x to double
450 %y.ext = fpext float %y to double
451 store double %x.ext, ptr %p
452 %minnum = call double @llvm.minnum.f64(double %x.ext, double %y.ext)
453 %trunc = fptrunc double %minnum to float
457 define float @reduce_precision_multi_use_1(float %x, float %y, ptr %p) {
458 ; CHECK-LABEL: @reduce_precision_multi_use_1(
459 ; CHECK-NEXT: [[X_EXT:%.*]] = fpext float [[X:%.*]] to double
460 ; CHECK-NEXT: [[Y_EXT:%.*]] = fpext float [[Y:%.*]] to double
461 ; CHECK-NEXT: store double [[Y_EXT]], ptr [[P:%.*]], align 8
462 ; CHECK-NEXT: [[MINNUM:%.*]] = call double @llvm.minnum.f64(double [[X_EXT]], double [[Y_EXT]])
463 ; CHECK-NEXT: [[TRUNC:%.*]] = fptrunc double [[MINNUM]] to float
464 ; CHECK-NEXT: ret float [[TRUNC]]
466 %x.ext = fpext float %x to double
467 %y.ext = fpext float %y to double
468 store double %y.ext, ptr %p
469 %minnum = call double @llvm.minnum.f64(double %x.ext, double %y.ext)
470 %trunc = fptrunc double %minnum to float
474 define float @negated_op(float %x) {
475 ; CHECK-LABEL: @negated_op(
476 ; CHECK-NEXT: [[TMP1:%.*]] = call float @llvm.fabs.f32(float [[X:%.*]])
477 ; CHECK-NEXT: [[R:%.*]] = fneg float [[TMP1]]
478 ; CHECK-NEXT: ret float [[R]]
480 %negx = fneg float %x
481 %r = call float @llvm.minnum.f32(float %x, float %negx)
485 define <2 x double> @negated_op_fmf_commute_vec(<2 x double> %x) {
486 ; CHECK-LABEL: @negated_op_fmf_commute_vec(
487 ; CHECK-NEXT: [[TMP1:%.*]] = call nnan ninf nsz <2 x double> @llvm.fabs.v2f64(<2 x double> [[X:%.*]])
488 ; CHECK-NEXT: [[R:%.*]] = fneg nnan ninf nsz <2 x double> [[TMP1]]
489 ; CHECK-NEXT: ret <2 x double> [[R]]
491 %negx = fneg <2 x double> %x
492 %r = call nsz nnan ninf <2 x double> @llvm.minnum.v2f64(<2 x double> %negx, <2 x double> %x)
496 define double @negated_op_extra_use(double %x) {
497 ; CHECK-LABEL: @negated_op_extra_use(
498 ; CHECK-NEXT: [[NEGX:%.*]] = fneg double [[X:%.*]]
499 ; CHECK-NEXT: call void @use(double [[NEGX]])
500 ; CHECK-NEXT: [[R:%.*]] = call double @llvm.minnum.f64(double [[NEGX]], double [[X]])
501 ; CHECK-NEXT: ret double [[R]]
503 %negx = fneg double %x
504 call void @use(double %negx)
505 %r = call double @llvm.minnum.f64(double %negx, double %x)