1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt < %s -S -passes=instsimplify | FileCheck %s
6 define i1 @nnan_call() {
7 ; CHECK-LABEL: @nnan_call(
8 ; CHECK-NEXT: [[OP:%.*]] = call nnan double @func()
9 ; CHECK-NEXT: ret i1 true
11 %op = call nnan double @func()
12 %tmp = fcmp ord double %op, %op
16 define i1 @nnan_fabs_src(double %arg) {
17 ; CHECK-LABEL: @nnan_fabs_src(
18 ; CHECK-NEXT: ret i1 false
20 %nnan = fadd nnan double %arg, 1.0
21 %op = call double @llvm.fabs.f64(double %nnan)
22 %tmp = fcmp uno double %op, %op
26 define i1 @nnan_canonicalize_src(double %arg) {
27 ; CHECK-LABEL: @nnan_canonicalize_src(
28 ; CHECK-NEXT: ret i1 true
30 %nnan = fadd nnan double %arg, 1.0
31 %op = call double @llvm.canonicalize.f64(double %nnan)
32 %tmp = fcmp ord double %op, %op
36 define i1 @nnan_copysign_src(double %arg0, double %arg1) {
37 ; CHECK-LABEL: @nnan_copysign_src(
38 ; CHECK-NEXT: ret i1 false
40 %nnan = fadd nnan double %arg0, 1.0
41 %op = call double @llvm.copysign.f64(double %nnan, double %arg1)
42 %tmp = fcmp uno double %op, %op
46 define i1 @fabs_sqrt_src(double %arg0, double %arg1) {
47 ; CHECK-LABEL: @fabs_sqrt_src(
48 ; CHECK-NEXT: ret i1 true
50 %nnan = fadd nnan double %arg0, 1.0
51 %fabs = call double @llvm.fabs.f64(double %nnan)
52 %op = call double @llvm.sqrt.f64(double %fabs)
53 %tmp = fcmp ord double %op, %op
57 define i1 @fabs_sqrt_src_maybe_nan(double %arg0, double %arg1) {
58 ; CHECK-LABEL: @fabs_sqrt_src_maybe_nan(
59 ; CHECK-NEXT: [[FABS:%.*]] = call double @llvm.fabs.f64(double [[ARG0:%.*]])
60 ; CHECK-NEXT: [[OP:%.*]] = call double @llvm.sqrt.f64(double [[FABS]])
61 ; CHECK-NEXT: [[TMP:%.*]] = fcmp uno double [[OP]], [[OP]]
62 ; CHECK-NEXT: ret i1 [[TMP]]
64 %fabs = call double @llvm.fabs.f64(double %arg0)
65 %op = call double @llvm.sqrt.f64(double %fabs)
66 %tmp = fcmp uno double %op, %op
70 define i1 @exp_nnan_src(double %arg) {
71 ; CHECK-LABEL: @exp_nnan_src(
72 ; CHECK-NEXT: ret i1 true
74 %nnan = fadd nnan double %arg, 1.0
75 %op = call double @llvm.exp.f64(double %nnan)
76 %tmp = fcmp ord double %op, %op
80 define i1 @exp2_nnan_src(double %arg) {
81 ; CHECK-LABEL: @exp2_nnan_src(
82 ; CHECK-NEXT: ret i1 false
84 %nnan = fadd nnan double %arg, 1.0
85 %op = call double @llvm.exp2.f64(double %nnan)
86 %tmp = fcmp uno double %op, %op
90 define i1 @floor_nnan_src(double %arg) {
91 ; CHECK-LABEL: @floor_nnan_src(
92 ; CHECK-NEXT: ret i1 true
94 %nnan = fadd nnan double %arg, 1.0
95 %op = call double @llvm.floor.f64(double %nnan)
96 %tmp = fcmp ord double %op, %op
100 define i1 @ceil_nnan_src(double %arg) {
101 ; CHECK-LABEL: @ceil_nnan_src(
102 ; CHECK-NEXT: ret i1 false
104 %nnan = fadd nnan double %arg, 1.0
105 %op = call double @llvm.ceil.f64(double %nnan)
106 %tmp = fcmp uno double %op, %op
110 define i1 @trunc_nnan_src(double %arg) {
111 ; CHECK-LABEL: @trunc_nnan_src(
112 ; CHECK-NEXT: ret i1 true
114 %nnan = fadd nnan double %arg, 1.0
115 %op = call double @llvm.trunc.f64(double %nnan)
116 %tmp = fcmp ord double %op, %op
120 define i1 @rint_nnan_src(double %arg) {
121 ; CHECK-LABEL: @rint_nnan_src(
122 ; CHECK-NEXT: ret i1 false
124 %nnan = fadd nnan double %arg, 1.0
125 %op = call double @llvm.rint.f64(double %nnan)
126 %tmp = fcmp uno double %op, %op
130 define i1 @nearbyint_nnan_src(double %arg) {
131 ; CHECK-LABEL: @nearbyint_nnan_src(
132 ; CHECK-NEXT: ret i1 true
134 %nnan = fadd nnan double %arg, 1.0
135 %op = call double @llvm.nearbyint.f64(double %nnan)
136 %tmp = fcmp ord double %op, %op
140 define i1 @round_nnan_src(double %arg) {
141 ; CHECK-LABEL: @round_nnan_src(
142 ; CHECK-NEXT: ret i1 false
144 %nnan = fadd nnan double %arg, 1.0
145 %op = call double @llvm.round.f64(double %nnan)
146 %tmp = fcmp uno double %op, %op
150 define i1 @roundeven_nnan_src(double %arg) {
151 ; CHECK-LABEL: @roundeven_nnan_src(
152 ; CHECK-NEXT: ret i1 false
154 %nnan = fadd nnan double %arg, 1.0
155 %op = call double @llvm.roundeven.f64(double %nnan)
156 %tmp = fcmp uno double %op, %op
160 define i1 @known_nan_select(i1 %cond, double %arg0, double %arg1) {
161 ; CHECK-LABEL: @known_nan_select(
162 ; CHECK-NEXT: ret i1 true
164 %lhs = fadd nnan double %arg0, 1.0
165 %rhs = fadd nnan double %arg1, 2.0
166 %op = select i1 %cond, double %lhs, double %rhs
167 %tmp = fcmp ord double %op, %op
171 define i1 @nnan_ninf_known_nan_select(i1 %cond, double %arg0, double %arg1) {
172 ; CHECK-LABEL: @nnan_ninf_known_nan_select(
173 ; CHECK-NEXT: ret i1 true
175 %lhs = fadd nnan ninf double %arg0, 1.0
176 %rhs = fadd nnan ninf double %arg1, 2.0
177 %op = select i1 %cond, double %lhs, double %rhs
178 %mul = fmul double %op, 2.0
179 %tmp = fcmp ord double %mul, %mul
183 define i1 @select_maybe_nan_lhs(i1 %cond, double %lhs, double %arg1) {
184 ; CHECK-LABEL: @select_maybe_nan_lhs(
185 ; CHECK-NEXT: [[RHS:%.*]] = fadd nnan double [[ARG1:%.*]], 1.000000e+00
186 ; CHECK-NEXT: [[OP:%.*]] = select i1 [[COND:%.*]], double [[LHS:%.*]], double [[RHS]]
187 ; CHECK-NEXT: [[TMP:%.*]] = fcmp uno double [[OP]], [[OP]]
188 ; CHECK-NEXT: ret i1 [[TMP]]
190 %rhs = fadd nnan double %arg1, 1.0
191 %op = select i1 %cond, double %lhs, double %rhs
192 %tmp = fcmp uno double %op, %op
196 define i1 @select_maybe_nan_rhs(i1 %cond, double %arg0, double %rhs) {
197 ; CHECK-LABEL: @select_maybe_nan_rhs(
198 ; CHECK-NEXT: [[LHS:%.*]] = fadd nnan double [[ARG0:%.*]], 1.000000e+00
199 ; CHECK-NEXT: [[OP:%.*]] = select i1 [[COND:%.*]], double [[LHS]], double [[RHS:%.*]]
200 ; CHECK-NEXT: [[TMP:%.*]] = fcmp ord double [[OP]], [[OP]]
201 ; CHECK-NEXT: ret i1 [[TMP]]
203 %lhs = fadd nnan double %arg0, 1.0
204 %op = select i1 %cond, double %lhs, double %rhs
205 %tmp = fcmp ord double %op, %op
209 define i1 @nnan_fadd(double %arg0, double %arg1) {
210 ; CHECK-LABEL: @nnan_fadd(
211 ; CHECK-NEXT: [[NNAN_ARG0:%.*]] = fadd nnan double [[ARG0:%.*]], 1.000000e+00
212 ; CHECK-NEXT: [[NNAN_ARG1:%.*]] = fadd nnan double [[ARG0]], 2.000000e+00
213 ; CHECK-NEXT: [[OP:%.*]] = fadd double [[NNAN_ARG0]], [[NNAN_ARG1]]
214 ; CHECK-NEXT: [[TMP:%.*]] = fcmp uno double [[OP]], [[OP]]
215 ; CHECK-NEXT: ret i1 [[TMP]]
217 %nnan.arg0 = fadd nnan double %arg0, 1.0
218 %nnan.arg1 = fadd nnan double %arg0, 2.0
219 %op = fadd double %nnan.arg0, %nnan.arg1
220 %tmp = fcmp uno double %op, %op
224 define i1 @nnan_fadd_maybe_nan_lhs(double %arg0, double %arg1) {
225 ; CHECK-LABEL: @nnan_fadd_maybe_nan_lhs(
226 ; CHECK-NEXT: [[NNAN_ARG1:%.*]] = fadd nnan double [[ARG1:%.*]], 1.000000e+00
227 ; CHECK-NEXT: [[OP:%.*]] = fadd double [[ARG0:%.*]], [[NNAN_ARG1]]
228 ; CHECK-NEXT: [[TMP:%.*]] = fcmp ord double [[OP]], [[OP]]
229 ; CHECK-NEXT: ret i1 [[TMP]]
231 %nnan.arg1 = fadd nnan double %arg1, 1.0
232 %op = fadd double %arg0, %nnan.arg1
233 %tmp = fcmp ord double %op, %op
237 define i1 @nnan_fadd_maybe_nan_rhs(double %arg0, double %arg1) {
238 ; CHECK-LABEL: @nnan_fadd_maybe_nan_rhs(
239 ; CHECK-NEXT: [[NNAN_ARG0:%.*]] = fadd nnan double [[ARG0:%.*]], 1.000000e+00
240 ; CHECK-NEXT: [[OP:%.*]] = fadd double [[NNAN_ARG0]], [[ARG1:%.*]]
241 ; CHECK-NEXT: [[TMP:%.*]] = fcmp uno double [[OP]], [[OP]]
242 ; CHECK-NEXT: ret i1 [[TMP]]
244 %nnan.arg0 = fadd nnan double %arg0, 1.0
245 %op = fadd double %nnan.arg0, %arg1
246 %tmp = fcmp uno double %op, %op
250 define i1 @nnan_fmul(double %arg0, double %arg1) {
251 ; CHECK-LABEL: @nnan_fmul(
252 ; CHECK-NEXT: [[NNAN_ARG0:%.*]] = fadd nnan double [[ARG0:%.*]], 1.000000e+00
253 ; CHECK-NEXT: [[NNAN_ARG1:%.*]] = fadd nnan double [[ARG0]], 2.000000e+00
254 ; CHECK-NEXT: [[OP:%.*]] = fmul double [[NNAN_ARG0]], [[NNAN_ARG1]]
255 ; CHECK-NEXT: [[TMP:%.*]] = fcmp ord double [[OP]], [[OP]]
256 ; CHECK-NEXT: ret i1 [[TMP]]
258 %nnan.arg0 = fadd nnan double %arg0, 1.0
259 %nnan.arg1 = fadd nnan double %arg0, 2.0
260 %op = fmul double %nnan.arg0, %nnan.arg1
261 %tmp = fcmp ord double %op, %op
265 define i1 @nnan_fsub(double %arg0, double %arg1) {
266 ; CHECK-LABEL: @nnan_fsub(
267 ; CHECK-NEXT: [[NNAN_ARG0:%.*]] = fadd nnan double [[ARG0:%.*]], 1.000000e+00
268 ; CHECK-NEXT: [[NNAN_ARG1:%.*]] = fadd nnan double [[ARG0]], 2.000000e+00
269 ; CHECK-NEXT: [[OP:%.*]] = fsub double [[NNAN_ARG0]], [[NNAN_ARG1]]
270 ; CHECK-NEXT: [[TMP:%.*]] = fcmp uno double [[OP]], [[OP]]
271 ; CHECK-NEXT: ret i1 [[TMP]]
273 %nnan.arg0 = fadd nnan double %arg0, 1.0
274 %nnan.arg1 = fadd nnan double %arg0, 2.0
275 %op = fsub double %nnan.arg0, %nnan.arg1
276 %tmp = fcmp uno double %op, %op
280 define i1 @nnan_binary_fneg() {
281 ; CHECK-LABEL: @nnan_binary_fneg(
282 ; CHECK-NEXT: [[NNAN:%.*]] = call nnan double @func()
283 ; CHECK-NEXT: ret i1 true
285 %nnan = call nnan double @func()
286 %op = fsub double -0.0, %nnan
287 %tmp = fcmp ord double %op, %op
291 define i1 @nnan_unary_fneg() {
292 ; CHECK-LABEL: @nnan_unary_fneg(
293 ; CHECK-NEXT: [[NNAN:%.*]] = call nnan double @func()
294 ; CHECK-NEXT: ret i1 true
296 %nnan = call nnan double @func()
297 %op = fneg double %nnan
298 %tmp = fcmp ord double %op, %op
302 define i1 @isNotKnownNeverNaN_fneg(double %x) {
303 ; CHECK-LABEL: @isNotKnownNeverNaN_fneg(
304 ; CHECK-NEXT: [[NEG:%.*]] = fneg double [[X:%.*]]
305 ; CHECK-NEXT: [[CMP:%.*]] = fcmp ord double [[NEG]], [[NEG]]
306 ; CHECK-NEXT: ret i1 [[CMP]]
308 %neg = fneg double %x
309 %cmp = fcmp ord double %neg, %neg
313 define i1 @sitofp(i32 %arg0) {
314 ; CHECK-LABEL: @sitofp(
315 ; CHECK-NEXT: ret i1 false
317 %op = sitofp i32 %arg0 to double
318 %tmp = fcmp uno double %op, %op
322 define i1 @uitofp(i32 %arg0) {
323 ; CHECK-LABEL: @uitofp(
324 ; CHECK-NEXT: ret i1 true
326 %op = uitofp i32 %arg0 to double
327 %tmp = fcmp ord double %op, %op
331 define i1 @uitofp_add(i32 %arg0) {
332 ; CHECK-LABEL: @uitofp_add(
333 ; CHECK-NEXT: ret i1 true
335 %op = uitofp i32 %arg0 to double
336 %add = fadd double %op, %op
337 %tmp = fcmp ord double %add, %add
341 define i1 @uitofp_add_big(i1024 %arg0) {
342 ; CHECK-LABEL: @uitofp_add_big(
343 ; CHECK-NEXT: [[OP:%.*]] = uitofp i1024 [[ARG0:%.*]] to double
344 ; CHECK-NEXT: [[ADD:%.*]] = fadd double [[OP]], [[OP]]
345 ; CHECK-NEXT: [[TMP:%.*]] = fcmp ord double [[ADD]], [[ADD]]
346 ; CHECK-NEXT: ret i1 [[TMP]]
348 %op = uitofp i1024 %arg0 to double
349 %add = fadd double %op, %op
350 %tmp = fcmp ord double %add, %add
354 define i1 @fpext(float %arg0) {
355 ; CHECK-LABEL: @fpext(
356 ; CHECK-NEXT: ret i1 false
358 %arg0.nnan = fadd nnan float %arg0, 1.0
359 %op = fpext float %arg0.nnan to double
360 %tmp = fcmp uno double %op, %op
364 define i1 @fpext_maybe_nan(float %arg0) {
365 ; CHECK-LABEL: @fpext_maybe_nan(
366 ; CHECK-NEXT: [[OP:%.*]] = fpext float [[ARG0:%.*]] to double
367 ; CHECK-NEXT: [[TMP:%.*]] = fcmp ord double [[OP]], [[OP]]
368 ; CHECK-NEXT: ret i1 [[TMP]]
370 %op = fpext float %arg0 to double
371 %tmp = fcmp ord double %op, %op
375 define i1 @fptrunc(double %arg0) {
376 ; CHECK-LABEL: @fptrunc(
377 ; CHECK-NEXT: ret i1 false
379 %arg0.nnan = fadd nnan double %arg0, 1.0
380 %op = fptrunc double %arg0.nnan to float
381 %tmp = fcmp uno float %op, %op
385 define i1 @fptrunc_maybe_nan(double %arg0) {
386 ; CHECK-LABEL: @fptrunc_maybe_nan(
387 ; CHECK-NEXT: [[OP:%.*]] = fptrunc double [[ARG0:%.*]] to float
388 ; CHECK-NEXT: [[TMP:%.*]] = fcmp ord float [[OP]], [[OP]]
389 ; CHECK-NEXT: ret i1 [[TMP]]
391 %op = fptrunc double %arg0 to float
392 %tmp = fcmp ord float %op, %op
396 define i1 @nnan_fdiv(double %arg0, double %arg1) {
397 ; CHECK-LABEL: @nnan_fdiv(
398 ; CHECK-NEXT: [[NNAN_ARG0:%.*]] = fadd nnan double [[ARG0:%.*]], 1.000000e+00
399 ; CHECK-NEXT: [[NNAN_ARG1:%.*]] = fadd nnan double [[ARG0]], 2.000000e+00
400 ; CHECK-NEXT: [[OP:%.*]] = fdiv double [[NNAN_ARG0]], [[NNAN_ARG1]]
401 ; CHECK-NEXT: [[TMP:%.*]] = fcmp uno double [[OP]], [[OP]]
402 ; CHECK-NEXT: ret i1 [[TMP]]
404 %nnan.arg0 = fadd nnan double %arg0, 1.0
405 %nnan.arg1 = fadd nnan double %arg0, 2.0
406 %op = fdiv double %nnan.arg0, %nnan.arg1
407 %tmp = fcmp uno double %op, %op
411 define i1 @nnan_frem(double %arg0, double %arg1) {
412 ; CHECK-LABEL: @nnan_frem(
413 ; CHECK-NEXT: [[NNAN_ARG0:%.*]] = fadd nnan double [[ARG0:%.*]], 1.000000e+00
414 ; CHECK-NEXT: [[NNAN_ARG1:%.*]] = fadd nnan double [[ARG0]], 2.000000e+00
415 ; CHECK-NEXT: [[OP:%.*]] = frem double [[NNAN_ARG0]], [[NNAN_ARG1]]
416 ; CHECK-NEXT: [[TMP:%.*]] = fcmp ord double [[OP]], [[OP]]
417 ; CHECK-NEXT: ret i1 [[TMP]]
419 %nnan.arg0 = fadd nnan double %arg0, 1.0
420 %nnan.arg1 = fadd nnan double %arg0, 2.0
421 %op = frem double %nnan.arg0, %nnan.arg1
422 %tmp = fcmp ord double %op, %op
426 define i1 @nnan_arithemtic_fence_src(double %arg) {
427 ; CHECK-LABEL: @nnan_arithemtic_fence_src(
428 ; CHECK-NEXT: ret i1 true
430 %nnan = fadd nnan double %arg, 1.0
431 %op = call double @llvm.arithmetic.fence.f64(double %nnan)
432 %tmp = fcmp ord double %op, %op
436 declare double @llvm.sqrt.f64(double)
437 declare double @llvm.fabs.f64(double)
438 declare double @llvm.canonicalize.f64(double)
439 declare double @llvm.copysign.f64(double, double)
440 declare double @llvm.exp.f64(double)
441 declare double @llvm.exp2.f64(double)
442 declare double @llvm.floor.f64(double)
443 declare double @llvm.ceil.f64(double)
444 declare double @llvm.trunc.f64(double)
445 declare double @llvm.rint.f64(double)
446 declare double @llvm.nearbyint.f64(double)
447 declare double @llvm.round.f64(double)
448 declare double @llvm.roundeven.f64(double)
449 declare double @llvm.arithmetic.fence.f64(double)
452 define i1 @isKnownNeverNaN_nofpclass_nan_arg(double nofpclass(nan) %arg) {
453 ; CHECK-LABEL: @isKnownNeverNaN_nofpclass_nan_arg(
454 ; CHECK-NEXT: ret i1 true
456 %tmp = fcmp ord double %arg, %arg
460 ; Not enough nan tested
461 define i1 @isKnownNeverNaN_nofpclass_qnan_arg(double nofpclass(qnan) %arg) {
462 ; CHECK-LABEL: @isKnownNeverNaN_nofpclass_qnan_arg(
463 ; CHECK-NEXT: [[TMP:%.*]] = fcmp ord double [[ARG:%.*]], [[ARG]]
464 ; CHECK-NEXT: ret i1 [[TMP]]
466 %tmp = fcmp ord double %arg, %arg
470 ; Not enough nan tested
471 define i1 @isKnownNeverNaN_nofpclass_snan_arg(double nofpclass(snan) %arg) {
472 ; CHECK-LABEL: @isKnownNeverNaN_nofpclass_snan_arg(
473 ; CHECK-NEXT: [[TMP:%.*]] = fcmp ord double [[ARG:%.*]], [[ARG]]
474 ; CHECK-NEXT: ret i1 [[TMP]]
476 %tmp = fcmp ord double %arg, %arg
481 define i1 @isKnownNeverNaN_nofpclass_zero_arg(double nofpclass(zero) %arg) {
482 ; CHECK-LABEL: @isKnownNeverNaN_nofpclass_zero_arg(
483 ; CHECK-NEXT: [[TMP:%.*]] = fcmp ord double [[ARG:%.*]], [[ARG]]
484 ; CHECK-NEXT: ret i1 [[TMP]]
486 %tmp = fcmp ord double %arg, %arg
490 declare nofpclass(nan) double @declare_no_nan_return()
491 declare double @unknown_return()
493 define i1 @isKnownNeverNaN_nofpclass_call_decl() {
494 ; CHECK-LABEL: @isKnownNeverNaN_nofpclass_call_decl(
495 ; CHECK-NEXT: [[CALL:%.*]] = call double @declare_no_nan_return()
496 ; CHECK-NEXT: ret i1 true
498 %call = call double @declare_no_nan_return()
499 %tmp = fcmp ord double %call, %call
503 define i1 @isKnownNeverNaN_nofpclass_callsite() {
504 ; CHECK-LABEL: @isKnownNeverNaN_nofpclass_callsite(
505 ; CHECK-NEXT: [[CALL:%.*]] = call nofpclass(nan) double @unknown_return()
506 ; CHECK-NEXT: ret i1 true
508 %call = call nofpclass(nan) double @unknown_return()
509 %tmp = fcmp ord double %call, %call
513 declare nofpclass(sub norm zero inf) double @only_nans()
515 ; TODO: Could simplify to false
516 define i1 @isKnownNeverNaN_only_nans() {
517 ; CHECK-LABEL: @isKnownNeverNaN_only_nans(
518 ; CHECK-NEXT: [[CALL:%.*]] = call double @only_nans()
519 ; CHECK-NEXT: [[TMP:%.*]] = fcmp ord double [[CALL]], [[CALL]]
520 ; CHECK-NEXT: ret i1 [[TMP]]
522 %call = call double @only_nans()
523 %tmp = fcmp ord double %call, %call
527 define i1 @isKnownNeverNaN_nofpclass_indirect_callsite(ptr %fptr) {
528 ; CHECK-LABEL: @isKnownNeverNaN_nofpclass_indirect_callsite(
529 ; CHECK-NEXT: [[CALL:%.*]] = call nofpclass(nan) double [[FPTR:%.*]]()
530 ; CHECK-NEXT: ret i1 true
532 %call = call nofpclass(nan) double %fptr()
533 %tmp = fcmp ord double %call, %call
537 define i1 @isKnownNeverNaN_invoke_callsite(ptr %ptr) personality i8 1 {
538 ; CHECK-LABEL: @isKnownNeverNaN_invoke_callsite(
539 ; CHECK-NEXT: [[INVOKE:%.*]] = invoke nofpclass(nan) float [[PTR:%.*]]()
540 ; CHECK-NEXT: to label [[NORMAL:%.*]] unwind label [[UNWIND:%.*]]
542 ; CHECK-NEXT: ret i1 true
544 ; CHECK-NEXT: [[TMP1:%.*]] = landingpad ptr
545 ; CHECK-NEXT: cleanup
546 ; CHECK-NEXT: resume ptr null
548 %invoke = invoke nofpclass(nan) float %ptr() to label %normal unwind label %unwind
551 %ord = fcmp ord float %invoke, 0.0
555 landingpad ptr cleanup
559 ; This should not fold to false because fmul 0 * inf = nan
560 define i1 @issue63316(i64 %arg) {
561 ; CHECK-LABEL: @issue63316(
562 ; CHECK-NEXT: [[SITOFP:%.*]] = sitofp i64 [[ARG:%.*]] to float
563 ; CHECK-NEXT: [[FMUL:%.*]] = fmul float [[SITOFP]], 0x7FF0000000000000
564 ; CHECK-NEXT: [[FCMP:%.*]] = fcmp uno float [[FMUL]], 0.000000e+00
565 ; CHECK-NEXT: ret i1 [[FCMP]]
567 %sitofp = sitofp i64 %arg to float
568 %fmul = fmul float %sitofp, 0x7FF0000000000000
569 %fcmp = fcmp uno float %fmul, 0.000000e+00
573 define i1 @issue63316_commute(i64 %arg) {
574 ; CHECK-LABEL: @issue63316_commute(
575 ; CHECK-NEXT: [[SITOFP:%.*]] = sitofp i64 [[ARG:%.*]] to float
576 ; CHECK-NEXT: [[FMUL:%.*]] = fmul float 0x7FF0000000000000, [[SITOFP]]
577 ; CHECK-NEXT: [[FCMP:%.*]] = fcmp uno float [[FMUL]], 0.000000e+00
578 ; CHECK-NEXT: ret i1 [[FCMP]]
580 %sitofp = sitofp i64 %arg to float
581 %fmul = fmul float 0x7FF0000000000000, %sitofp
582 %fcmp = fcmp uno float %fmul, 0.000000e+00