1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt -passes=instcombine -S < %s | FileCheck %s
4 declare double @llvm.powi.f64.i16(double, i16) nounwind readonly
5 declare double @llvm.powi.f64.i32(double, i32) nounwind readonly
6 declare i32 @llvm.cttz.i32(i32, i1) nounwind readnone
7 declare i32 @llvm.ctlz.i32(i32, i1) nounwind readnone
8 declare i1 @llvm.cttz.i1(i1, i1) nounwind readnone
9 declare i1 @llvm.ctlz.i1(i1, i1) nounwind readnone
10 declare <2 x i1> @llvm.cttz.v2i1(<2 x i1>, i1) nounwind readnone
11 declare <2 x i1> @llvm.ctlz.v2i1(<2 x i1>, i1) nounwind readnone
12 declare i32 @llvm.ctpop.i32(i32) nounwind readnone
13 declare <2 x i32> @llvm.cttz.v2i32(<2 x i32>, i1) nounwind readnone
14 declare <2 x i32> @llvm.ctlz.v2i32(<2 x i32>, i1) nounwind readnone
15 declare <2 x i32> @llvm.ctpop.v2i32(<2 x i32>) nounwind readnone
16 declare i8 @llvm.ctlz.i8(i8, i1) nounwind readnone
17 declare <2 x i8> @llvm.ctlz.v2i8(<2 x i8>, i1) nounwind readnone
18 declare double @llvm.cos.f64(double %Val) nounwind readonly
19 declare double @llvm.sin.f64(double %Val) nounwind readonly
20 declare double @llvm.floor.f64(double %Val) nounwind readonly
21 declare double @llvm.ceil.f64(double %Val) nounwind readonly
22 declare double @llvm.trunc.f64(double %Val) nounwind readonly
23 declare double @llvm.rint.f64(double %Val) nounwind readonly
24 declare double @llvm.nearbyint.f64(double %Val) nounwind readonly
25 declare <vscale x 1 x i32> @llvm.cttz.nxv1i32(<vscale x 1 x i32>, i1) nounwind readnone
27 define void @powi(double %V, ptr %P) {
29 ; CHECK-NEXT: [[A:%.*]] = fdiv fast double 1.000000e+00, [[V:%.*]]
30 ; CHECK-NEXT: store volatile double [[A]], ptr [[P:%.*]], align 8
31 ; CHECK-NEXT: [[D:%.*]] = fmul nnan double [[V]], [[V]]
32 ; CHECK-NEXT: store volatile double [[D]], ptr [[P]], align 8
33 ; CHECK-NEXT: [[A2:%.*]] = fdiv fast double 1.000000e+00, [[V]]
34 ; CHECK-NEXT: store volatile double [[A2]], ptr [[P]], align 8
35 ; CHECK-NEXT: [[D2:%.*]] = fmul nnan double [[V]], [[V]]
36 ; CHECK-NEXT: store volatile double [[D2]], ptr [[P]], align 8
37 ; CHECK-NEXT: ret void
39 %A = tail call fast double @llvm.powi.f64.i32(double %V, i32 -1) nounwind
40 store volatile double %A, ptr %P
42 %D = tail call nnan double @llvm.powi.f64.i32(double %V, i32 2) nounwind
43 store volatile double %D, ptr %P
45 %A2 = tail call fast double @llvm.powi.f64.i16(double %V, i16 -1) nounwind
46 store volatile double %A2, ptr %P
48 %D2 = tail call nnan double @llvm.powi.f64.i16(double %V, i16 2) nounwind
49 store volatile double %D2, ptr %P
53 define i32 @cttz(i32 %a) {
55 ; CHECK-NEXT: ret i32 3
58 %and = and i32 %or, -8
59 %count = tail call i32 @llvm.cttz.i32(i32 %and, i1 true) nounwind readnone
63 define <2 x i32> @cttz_vec(<2 x i32> %a) {
64 ; CHECK-LABEL: @cttz_vec(
65 ; CHECK-NEXT: ret <2 x i32> <i32 3, i32 3>
67 %or = or <2 x i32> %a, <i32 8, i32 8>
68 %and = and <2 x i32> %or, <i32 -8, i32 -8>
69 %count = tail call <2 x i32> @llvm.cttz.v2i32(<2 x i32> %and, i1 true) nounwind readnone
73 ; Make sure we don't add range metadata to i1 cttz.
74 define i1 @cttz_i1(i1 %arg) {
75 ; CHECK-LABEL: @cttz_i1(
76 ; CHECK-NEXT: [[CNT:%.*]] = xor i1 [[ARG:%.*]], true
77 ; CHECK-NEXT: ret i1 [[CNT]]
79 %cnt = call i1 @llvm.cttz.i1(i1 %arg, i1 false) nounwind readnone
83 define i1 @cttz_i1_zero_is_poison(i1 %arg) {
84 ; CHECK-LABEL: @cttz_i1_zero_is_poison(
85 ; CHECK-NEXT: ret i1 false
87 %cnt = call i1 @llvm.cttz.i1(i1 %arg, i1 true) nounwind readnone
91 define <2 x i1> @cttz_v2i1(<2 x i1> %arg) {
92 ; CHECK-LABEL: @cttz_v2i1(
93 ; CHECK-NEXT: [[CNT:%.*]] = xor <2 x i1> [[ARG:%.*]], <i1 true, i1 true>
94 ; CHECK-NEXT: ret <2 x i1> [[CNT]]
96 %cnt = call <2 x i1> @llvm.cttz.v2i1(<2 x i1> %arg, i1 false) nounwind readnone
100 define <2 x i1> @cttz_v2i1_zero_is_poison(<2 x i1> %arg) {
101 ; CHECK-LABEL: @cttz_v2i1_zero_is_poison(
102 ; CHECK-NEXT: ret <2 x i1> zeroinitializer
104 %cnt = call <2 x i1> @llvm.cttz.v2i1(<2 x i1> %arg, i1 true) nounwind readnone
108 define i1 @cttz_knownbits(i32 %arg) {
109 ; CHECK-LABEL: @cttz_knownbits(
110 ; CHECK-NEXT: ret i1 false
113 %cnt = call i32 @llvm.cttz.i32(i32 %or, i1 true) nounwind readnone
114 %res = icmp eq i32 %cnt, 4
118 define <2 x i1> @cttz_knownbits_vec(<2 x i32> %arg) {
119 ; CHECK-LABEL: @cttz_knownbits_vec(
120 ; CHECK-NEXT: ret <2 x i1> zeroinitializer
122 %or = or <2 x i32> %arg, <i32 4, i32 4>
123 %cnt = call <2 x i32> @llvm.cttz.v2i32(<2 x i32> %or, i1 true) nounwind readnone
124 %res = icmp eq <2 x i32> %cnt, <i32 4, i32 4>
128 define <vscale x 1 x i1> @cttz_knownbits_scalable_vec(<vscale x 1 x i32> %arg) {
129 ; CHECK-LABEL: @cttz_knownbits_scalable_vec(
130 ; CHECK-NEXT: ret <vscale x 1 x i1> zeroinitializer
132 %or = or <vscale x 1 x i32> %arg, shufflevector (<vscale x 1 x i32> insertelement (<vscale x 1 x i32> poison, i32 4, i32 0), <vscale x 1 x i32> poison, <vscale x 1 x i32> zeroinitializer)
133 %cnt = call <vscale x 1 x i32> @llvm.cttz.nxv1i32(<vscale x 1 x i32> %or, i1 true) nounwind readnone
134 %res = icmp eq <vscale x 1 x i32> %cnt, shufflevector (<vscale x 1 x i32> insertelement (<vscale x 1 x i32> poison, i32 4, i32 0), <vscale x 1 x i32> poison, <vscale x 1 x i32> zeroinitializer)
135 ret <vscale x 1 x i1> %res
139 define i32 @cttz_knownbits2(i32 %arg) {
140 ; CHECK-LABEL: @cttz_knownbits2(
141 ; CHECK-NEXT: [[OR:%.*]] = or i32 [[ARG:%.*]], 4
142 ; CHECK-NEXT: [[CNT:%.*]] = call i32 @llvm.cttz.i32(i32 [[OR]], i1 true) #[[ATTR2:[0-9]+]], !range [[RNG0:![0-9]+]]
143 ; CHECK-NEXT: ret i32 [[CNT]]
146 %cnt = call i32 @llvm.cttz.i32(i32 %or, i1 true) nounwind readnone
150 define <2 x i32> @cttz_knownbits2_vec(<2 x i32> %arg) {
151 ; CHECK-LABEL: @cttz_knownbits2_vec(
152 ; CHECK-NEXT: [[OR:%.*]] = or <2 x i32> [[ARG:%.*]], <i32 4, i32 4>
153 ; CHECK-NEXT: [[CNT:%.*]] = call <2 x i32> @llvm.cttz.v2i32(<2 x i32> [[OR]], i1 true) #[[ATTR2]], !range [[RNG0]]
154 ; CHECK-NEXT: ret <2 x i32> [[CNT]]
156 %or = or <2 x i32> %arg, <i32 4, i32 4>
157 %cnt = call <2 x i32> @llvm.cttz.v2i32(<2 x i32> %or, i1 true) nounwind readnone
161 define i1 @cttz_knownbits3(i32 %arg) {
162 ; CHECK-LABEL: @cttz_knownbits3(
163 ; CHECK-NEXT: ret i1 false
166 %cnt = call i32 @llvm.cttz.i32(i32 %or, i1 true) nounwind readnone
167 %res = icmp eq i32 %cnt, 3
171 define <2 x i1> @cttz_knownbits3_vec(<2 x i32> %arg) {
172 ; CHECK-LABEL: @cttz_knownbits3_vec(
173 ; CHECK-NEXT: ret <2 x i1> zeroinitializer
175 %or = or <2 x i32> %arg, <i32 4, i32 4>
176 %cnt = call <2 x i32> @llvm.cttz.v2i32(<2 x i32> %or, i1 true) nounwind readnone
177 %res = icmp eq <2 x i32> %cnt, <i32 3, i32 3>
181 define i8 @ctlz(i8 %a) {
182 ; CHECK-LABEL: @ctlz(
183 ; CHECK-NEXT: ret i8 2
186 %and = and i8 %or, 63
187 %count = tail call i8 @llvm.ctlz.i8(i8 %and, i1 true) nounwind readnone
191 define <2 x i8> @ctlz_vec(<2 x i8> %a) {
192 ; CHECK-LABEL: @ctlz_vec(
193 ; CHECK-NEXT: ret <2 x i8> <i8 2, i8 2>
195 %or = or <2 x i8> %a, <i8 32, i8 32>
196 %and = and <2 x i8> %or, <i8 63, i8 63>
197 %count = tail call <2 x i8> @llvm.ctlz.v2i8(<2 x i8> %and, i1 true) nounwind readnone
201 ; Make sure we don't add range metadata to i1 ctlz.
202 define i1 @ctlz_i1(i1 %arg) {
203 ; CHECK-LABEL: @ctlz_i1(
204 ; CHECK-NEXT: [[CNT:%.*]] = xor i1 [[ARG:%.*]], true
205 ; CHECK-NEXT: ret i1 [[CNT]]
207 %cnt = call i1 @llvm.ctlz.i1(i1 %arg, i1 false) nounwind readnone
211 define i1 @ctlz_i1_zero_is_poison(i1 %arg) {
212 ; CHECK-LABEL: @ctlz_i1_zero_is_poison(
213 ; CHECK-NEXT: ret i1 false
215 %cnt = call i1 @llvm.ctlz.i1(i1 %arg, i1 true) nounwind readnone
219 define <2 x i1> @ctlz_v2i1(<2 x i1> %arg) {
220 ; CHECK-LABEL: @ctlz_v2i1(
221 ; CHECK-NEXT: [[CNT:%.*]] = xor <2 x i1> [[ARG:%.*]], <i1 true, i1 true>
222 ; CHECK-NEXT: ret <2 x i1> [[CNT]]
224 %cnt = call <2 x i1> @llvm.ctlz.v2i1(<2 x i1> %arg, i1 false) nounwind readnone
228 define <2 x i1> @ctlz_v2i1_zero_is_poison(<2 x i1> %arg) {
229 ; CHECK-LABEL: @ctlz_v2i1_zero_is_poison(
230 ; CHECK-NEXT: ret <2 x i1> zeroinitializer
232 %cnt = call <2 x i1> @llvm.ctlz.v2i1(<2 x i1> %arg, i1 true) nounwind readnone
236 define i1 @ctlz_knownbits(i8 %arg) {
237 ; CHECK-LABEL: @ctlz_knownbits(
238 ; CHECK-NEXT: ret i1 false
241 %cnt = call i8 @llvm.ctlz.i8(i8 %or, i1 true) nounwind readnone
242 %res = icmp eq i8 %cnt, 4
246 define <2 x i1> @ctlz_knownbits_vec(<2 x i8> %arg) {
247 ; CHECK-LABEL: @ctlz_knownbits_vec(
248 ; CHECK-NEXT: ret <2 x i1> zeroinitializer
250 %or = or <2 x i8> %arg, <i8 32, i8 32>
251 %cnt = call <2 x i8> @llvm.ctlz.v2i8(<2 x i8> %or, i1 true) nounwind readnone
252 %res = icmp eq <2 x i8> %cnt, <i8 4, i8 4>
256 define i8 @ctlz_knownbits2(i8 %arg) {
257 ; CHECK-LABEL: @ctlz_knownbits2(
258 ; CHECK-NEXT: [[OR:%.*]] = or i8 [[ARG:%.*]], 32
259 ; CHECK-NEXT: [[CNT:%.*]] = call i8 @llvm.ctlz.i8(i8 [[OR]], i1 true) #[[ATTR2]], !range [[RNG1:![0-9]+]]
260 ; CHECK-NEXT: ret i8 [[CNT]]
263 %cnt = call i8 @llvm.ctlz.i8(i8 %or, i1 true) nounwind readnone
267 define <2 x i8> @ctlz_knownbits2_vec(<2 x i8> %arg) {
268 ; CHECK-LABEL: @ctlz_knownbits2_vec(
269 ; CHECK-NEXT: [[OR:%.*]] = or <2 x i8> [[ARG:%.*]], <i8 32, i8 32>
270 ; CHECK-NEXT: [[CNT:%.*]] = call <2 x i8> @llvm.ctlz.v2i8(<2 x i8> [[OR]], i1 true) #[[ATTR2]], !range [[RNG1]]
271 ; CHECK-NEXT: ret <2 x i8> [[CNT]]
273 %or = or <2 x i8> %arg, <i8 32, i8 32>
274 %cnt = call <2 x i8> @llvm.ctlz.v2i8(<2 x i8> %or, i1 true) nounwind readnone
278 define i1 @ctlz_knownbits3(i8 %arg) {
279 ; CHECK-LABEL: @ctlz_knownbits3(
280 ; CHECK-NEXT: ret i1 false
283 %cnt = call i8 @llvm.ctlz.i8(i8 %or, i1 true) nounwind readnone
284 %res = icmp eq i8 %cnt, 3
288 define <2 x i1> @ctlz_knownbits3_vec(<2 x i8> %arg) {
289 ; CHECK-LABEL: @ctlz_knownbits3_vec(
290 ; CHECK-NEXT: ret <2 x i1> zeroinitializer
292 %or = or <2 x i8> %arg, <i8 32, i8 32>
293 %cnt = call <2 x i8> @llvm.ctlz.v2i8(<2 x i8> %or, i1 true) nounwind readnone
294 %res = icmp eq <2 x i8> %cnt, <i8 3, i8 3>
298 define i32 @ctlz_poison(i32 %Value) {
299 ; CHECK-LABEL: @ctlz_poison(
300 ; CHECK-NEXT: ret i32 poison
302 %ctlz = call i32 @llvm.ctlz.i32(i32 0, i1 true)
306 define <2 x i32> @ctlz_poison_vec(<2 x i32> %Value) {
307 ; CHECK-LABEL: @ctlz_poison_vec(
308 ; CHECK-NEXT: ret <2 x i32> poison
310 %ctlz = call <2 x i32> @llvm.ctlz.v2i32(<2 x i32> zeroinitializer, i1 true)
314 define i32 @ctlz_no_zero(i32 %a) {
315 ; CHECK-LABEL: @ctlz_no_zero(
316 ; CHECK-NEXT: [[OR:%.*]] = or i32 [[A:%.*]], 8
317 ; CHECK-NEXT: [[CTLZ:%.*]] = tail call i32 @llvm.ctlz.i32(i32 [[OR]], i1 true), !range [[RNG2:![0-9]+]]
318 ; CHECK-NEXT: ret i32 [[CTLZ]]
321 %ctlz = tail call i32 @llvm.ctlz.i32(i32 %or, i1 false)
325 define <2 x i32> @ctlz_no_zero_vec(<2 x i32> %a) {
326 ; CHECK-LABEL: @ctlz_no_zero_vec(
327 ; CHECK-NEXT: [[OR:%.*]] = or <2 x i32> [[A:%.*]], <i32 8, i32 8>
328 ; CHECK-NEXT: [[CTLZ:%.*]] = tail call <2 x i32> @llvm.ctlz.v2i32(<2 x i32> [[OR]], i1 true), !range [[RNG2]]
329 ; CHECK-NEXT: ret <2 x i32> [[CTLZ]]
331 %or = or <2 x i32> %a, <i32 8, i32 8>
332 %ctlz = tail call <2 x i32> @llvm.ctlz.v2i32(<2 x i32> %or, i1 false)
336 define i32 @cttz_poison(i32 %Value) {
337 ; CHECK-LABEL: @cttz_poison(
338 ; CHECK-NEXT: ret i32 poison
340 %cttz = call i32 @llvm.cttz.i32(i32 0, i1 true)
344 define <2 x i32> @cttz_poison_vec(<2 x i32> %Value) {
345 ; CHECK-LABEL: @cttz_poison_vec(
346 ; CHECK-NEXT: ret <2 x i32> poison
348 %cttz = call <2 x i32> @llvm.cttz.v2i32(<2 x i32> zeroinitializer, i1 true)
352 define i32 @cttz_no_zero(i32 %a) {
353 ; CHECK-LABEL: @cttz_no_zero(
354 ; CHECK-NEXT: [[OR:%.*]] = or i32 [[A:%.*]], 8
355 ; CHECK-NEXT: [[CTTZ:%.*]] = tail call i32 @llvm.cttz.i32(i32 [[OR]], i1 true), !range [[RNG3:![0-9]+]]
356 ; CHECK-NEXT: ret i32 [[CTTZ]]
359 %cttz = tail call i32 @llvm.cttz.i32(i32 %or, i1 false)
363 define <2 x i32> @cttz_no_zero_vec(<2 x i32> %a) {
364 ; CHECK-LABEL: @cttz_no_zero_vec(
365 ; CHECK-NEXT: [[OR:%.*]] = or <2 x i32> [[A:%.*]], <i32 8, i32 8>
366 ; CHECK-NEXT: [[CTTZ:%.*]] = tail call <2 x i32> @llvm.cttz.v2i32(<2 x i32> [[OR]], i1 true), !range [[RNG3]]
367 ; CHECK-NEXT: ret <2 x i32> [[CTTZ]]
369 %or = or <2 x i32> %a, <i32 8, i32 8>
370 %cttz = tail call <2 x i32> @llvm.cttz.v2i32(<2 x i32> %or, i1 false)
374 define i32 @ctlz_select(i32 %Value) nounwind {
375 ; CHECK-LABEL: @ctlz_select(
376 ; CHECK-NEXT: [[CTLZ:%.*]] = call i32 @llvm.ctlz.i32(i32 [[VALUE:%.*]], i1 false), !range [[RNG4:![0-9]+]]
377 ; CHECK-NEXT: ret i32 [[CTLZ]]
379 %tobool = icmp ne i32 %Value, 0
380 %ctlz = call i32 @llvm.ctlz.i32(i32 %Value, i1 true)
381 %s = select i1 %tobool, i32 %ctlz, i32 32
385 define <2 x i32> @ctlz_select_vec(<2 x i32> %Value) nounwind {
386 ; CHECK-LABEL: @ctlz_select_vec(
387 ; CHECK-NEXT: [[CTLZ:%.*]] = call <2 x i32> @llvm.ctlz.v2i32(<2 x i32> [[VALUE:%.*]], i1 false), !range [[RNG4]]
388 ; CHECK-NEXT: ret <2 x i32> [[CTLZ]]
390 %tobool = icmp ne <2 x i32> %Value, zeroinitializer
391 %ctlz = call <2 x i32> @llvm.ctlz.v2i32(<2 x i32> %Value, i1 true)
392 %s = select <2 x i1> %tobool, <2 x i32> %ctlz, <2 x i32> <i32 32, i32 32>
396 define i32 @cttz_select(i32 %Value) nounwind {
397 ; CHECK-LABEL: @cttz_select(
398 ; CHECK-NEXT: [[CTTZ:%.*]] = call i32 @llvm.cttz.i32(i32 [[VALUE:%.*]], i1 false), !range [[RNG4]]
399 ; CHECK-NEXT: ret i32 [[CTTZ]]
401 %tobool = icmp ne i32 %Value, 0
402 %cttz = call i32 @llvm.cttz.i32(i32 %Value, i1 true)
403 %s = select i1 %tobool, i32 %cttz, i32 32
407 define <2 x i32> @cttz_select_vec(<2 x i32> %Value) nounwind {
408 ; CHECK-LABEL: @cttz_select_vec(
409 ; CHECK-NEXT: [[CTTZ:%.*]] = call <2 x i32> @llvm.cttz.v2i32(<2 x i32> [[VALUE:%.*]], i1 false), !range [[RNG4]]
410 ; CHECK-NEXT: ret <2 x i32> [[CTTZ]]
412 %tobool = icmp ne <2 x i32> %Value, zeroinitializer
413 %cttz = call <2 x i32> @llvm.cttz.v2i32(<2 x i32> %Value, i1 true)
414 %s = select <2 x i1> %tobool, <2 x i32> %cttz, <2 x i32> <i32 32, i32 32>
418 define void @cos(ptr %P) {
420 ; CHECK-NEXT: store volatile double 1.000000e+00, ptr [[P:%.*]], align 8
421 ; CHECK-NEXT: ret void
423 %B = tail call double @llvm.cos.f64(double 0.0) nounwind
424 store volatile double %B, ptr %P
429 define void @sin(ptr %P) {
431 ; CHECK-NEXT: store volatile double 0.000000e+00, ptr [[P:%.*]], align 8
432 ; CHECK-NEXT: ret void
434 %B = tail call double @llvm.sin.f64(double 0.0) nounwind
435 store volatile double %B, ptr %P
440 define void @floor(ptr %P) {
441 ; CHECK-LABEL: @floor(
442 ; CHECK-NEXT: store volatile double 1.000000e+00, ptr [[P:%.*]], align 8
443 ; CHECK-NEXT: store volatile double -2.000000e+00, ptr [[P]], align 8
444 ; CHECK-NEXT: ret void
446 %B = tail call double @llvm.floor.f64(double 1.5) nounwind
447 store volatile double %B, ptr %P
448 %C = tail call double @llvm.floor.f64(double -1.5) nounwind
449 store volatile double %C, ptr %P
453 define void @ceil(ptr %P) {
454 ; CHECK-LABEL: @ceil(
455 ; CHECK-NEXT: store volatile double 2.000000e+00, ptr [[P:%.*]], align 8
456 ; CHECK-NEXT: store volatile double -1.000000e+00, ptr [[P]], align 8
457 ; CHECK-NEXT: ret void
459 %B = tail call double @llvm.ceil.f64(double 1.5) nounwind
460 store volatile double %B, ptr %P
461 %C = tail call double @llvm.ceil.f64(double -1.5) nounwind
462 store volatile double %C, ptr %P
466 define void @trunc(ptr %P) {
467 ; CHECK-LABEL: @trunc(
468 ; CHECK-NEXT: store volatile double 1.000000e+00, ptr [[P:%.*]], align 8
469 ; CHECK-NEXT: store volatile double -1.000000e+00, ptr [[P]], align 8
470 ; CHECK-NEXT: ret void
472 %B = tail call double @llvm.trunc.f64(double 1.5) nounwind
473 store volatile double %B, ptr %P
474 %C = tail call double @llvm.trunc.f64(double -1.5) nounwind
475 store volatile double %C, ptr %P
479 define void @rint(ptr %P) {
480 ; CHECK-LABEL: @rint(
481 ; CHECK-NEXT: store volatile double 2.000000e+00, ptr [[P:%.*]], align 8
482 ; CHECK-NEXT: store volatile double -2.000000e+00, ptr [[P]], align 8
483 ; CHECK-NEXT: ret void
485 %B = tail call double @llvm.rint.f64(double 1.5) nounwind
486 store volatile double %B, ptr %P
487 %C = tail call double @llvm.rint.f64(double -1.5) nounwind
488 store volatile double %C, ptr %P
492 define void @nearbyint(ptr %P) {
493 ; CHECK-LABEL: @nearbyint(
494 ; CHECK-NEXT: store volatile double 2.000000e+00, ptr [[P:%.*]], align 8
495 ; CHECK-NEXT: store volatile double -2.000000e+00, ptr [[P]], align 8
496 ; CHECK-NEXT: ret void
498 %B = tail call double @llvm.nearbyint.f64(double 1.5) nounwind
499 store volatile double %B, ptr %P
500 %C = tail call double @llvm.nearbyint.f64(double -1.5) nounwind
501 store volatile double %C, ptr %P