1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 2
2 ; RUN: opt -aa-pipeline=basic-aa -passes=attributor -attributor-manifest-internal -S < %s | FileCheck %s --check-prefixes=CHECK,TUNIT
4 declare float @llvm.fptrunc.round.f32.f64(double, metadata)
6 define float @ret_fptrunc(double %arg0) {
7 ; CHECK-LABEL: define float @ret_fptrunc
8 ; CHECK-SAME: (double [[ARG0:%.*]]) #[[ATTR1:[0-9]+]] {
9 ; CHECK-NEXT: [[EXT:%.*]] = fptrunc double [[ARG0]] to float
10 ; CHECK-NEXT: ret float [[EXT]]
12 %ext = fptrunc double %arg0 to float
16 define float @ret_fptrunc_nonan(double nofpclass(nan) %arg0) {
17 ; CHECK-LABEL: define nofpclass(nan) float @ret_fptrunc_nonan
18 ; CHECK-SAME: (double nofpclass(nan) [[ARG0:%.*]]) #[[ATTR1]] {
19 ; CHECK-NEXT: [[EXT:%.*]] = fptrunc double [[ARG0]] to float
20 ; CHECK-NEXT: ret float [[EXT]]
22 %ext = fptrunc double %arg0 to float
26 define float @ret_fptrunc_noqnan(double nofpclass(qnan) %arg0) {
27 ; CHECK-LABEL: define float @ret_fptrunc_noqnan
28 ; CHECK-SAME: (double nofpclass(qnan) [[ARG0:%.*]]) #[[ATTR1]] {
29 ; CHECK-NEXT: [[EXT:%.*]] = fptrunc double [[ARG0]] to float
30 ; CHECK-NEXT: ret float [[EXT]]
32 %ext = fptrunc double %arg0 to float
36 define float @ret_fptrunc_nosnan(double nofpclass(snan) %arg0) {
37 ; CHECK-LABEL: define nofpclass(snan) float @ret_fptrunc_nosnan
38 ; CHECK-SAME: (double nofpclass(snan) [[ARG0:%.*]]) #[[ATTR1]] {
39 ; CHECK-NEXT: [[EXT:%.*]] = fptrunc double [[ARG0]] to float
40 ; CHECK-NEXT: ret float [[EXT]]
42 %ext = fptrunc double %arg0 to float
46 define float @ret_fptrunc_noinf(double nofpclass(inf) %arg0) {
47 ; CHECK-LABEL: define float @ret_fptrunc_noinf
48 ; CHECK-SAME: (double nofpclass(inf) [[ARG0:%.*]]) #[[ATTR1]] {
49 ; CHECK-NEXT: [[EXT:%.*]] = fptrunc double [[ARG0]] to float
50 ; CHECK-NEXT: ret float [[EXT]]
52 %ext = fptrunc double %arg0 to float
56 define float @ret_fptrunc_nopinf(double nofpclass(pinf) %arg0) {
57 ; CHECK-LABEL: define float @ret_fptrunc_nopinf
58 ; CHECK-SAME: (double nofpclass(pinf) [[ARG0:%.*]]) #[[ATTR1]] {
59 ; CHECK-NEXT: [[EXT:%.*]] = fptrunc double [[ARG0]] to float
60 ; CHECK-NEXT: ret float [[EXT]]
62 %ext = fptrunc double %arg0 to float
66 define float @ret_fptrunc_noninf(double nofpclass(ninf) %arg0) {
67 ; CHECK-LABEL: define float @ret_fptrunc_noninf
68 ; CHECK-SAME: (double nofpclass(ninf) [[ARG0:%.*]]) #[[ATTR1]] {
69 ; CHECK-NEXT: [[EXT:%.*]] = fptrunc double [[ARG0]] to float
70 ; CHECK-NEXT: ret float [[EXT]]
72 %ext = fptrunc double %arg0 to float
76 define float @ret_fptrunc_nozero(double nofpclass(zero) %arg0) {
77 ; CHECK-LABEL: define float @ret_fptrunc_nozero
78 ; CHECK-SAME: (double nofpclass(zero) [[ARG0:%.*]]) #[[ATTR1]] {
79 ; CHECK-NEXT: [[EXT:%.*]] = fptrunc double [[ARG0]] to float
80 ; CHECK-NEXT: ret float [[EXT]]
82 %ext = fptrunc double %arg0 to float
86 define float @ret_fptrunc_nopzero(double nofpclass(pzero) %arg0) {
87 ; CHECK-LABEL: define float @ret_fptrunc_nopzero
88 ; CHECK-SAME: (double nofpclass(pzero) [[ARG0:%.*]]) #[[ATTR1]] {
89 ; CHECK-NEXT: [[EXT:%.*]] = fptrunc double [[ARG0]] to float
90 ; CHECK-NEXT: ret float [[EXT]]
92 %ext = fptrunc double %arg0 to float
96 define float @ret_fptrunc_nonzero(double nofpclass(nzero) %arg0) {
97 ; CHECK-LABEL: define float @ret_fptrunc_nonzero
98 ; CHECK-SAME: (double nofpclass(nzero) [[ARG0:%.*]]) #[[ATTR1]] {
99 ; CHECK-NEXT: [[EXT:%.*]] = fptrunc double [[ARG0]] to float
100 ; CHECK-NEXT: ret float [[EXT]]
102 %ext = fptrunc double %arg0 to float
106 define float @ret_fptrunc_nonan_noinf(double nofpclass(nan inf) %arg0) {
107 ; CHECK-LABEL: define nofpclass(nan) float @ret_fptrunc_nonan_noinf
108 ; CHECK-SAME: (double nofpclass(nan inf) [[ARG0:%.*]]) #[[ATTR1]] {
109 ; CHECK-NEXT: [[EXT:%.*]] = fptrunc double [[ARG0]] to float
110 ; CHECK-NEXT: ret float [[EXT]]
112 %ext = fptrunc double %arg0 to float
116 define float @ret_fptrunc_nosub(double nofpclass(sub) %arg0) {
117 ; CHECK-LABEL: define float @ret_fptrunc_nosub
118 ; CHECK-SAME: (double nofpclass(sub) [[ARG0:%.*]]) #[[ATTR1]] {
119 ; CHECK-NEXT: [[EXT:%.*]] = fptrunc double [[ARG0]] to float
120 ; CHECK-NEXT: ret float [[EXT]]
122 %ext = fptrunc double %arg0 to float
126 define float @ret_fptrunc_nonorm(double nofpclass(norm) %arg0) {
127 ; CHECK-LABEL: define float @ret_fptrunc_nonorm
128 ; CHECK-SAME: (double nofpclass(norm) [[ARG0:%.*]]) #[[ATTR1]] {
129 ; CHECK-NEXT: [[EXT:%.*]] = fptrunc double [[ARG0]] to float
130 ; CHECK-NEXT: ret float [[EXT]]
132 %ext = fptrunc double %arg0 to float
136 define float @ret_fptrunc_posonly(double nofpclass(ninf nnorm nsub nzero) %arg0) {
137 ; CHECK-LABEL: define nofpclass(ninf nsub nnorm) float @ret_fptrunc_posonly
138 ; CHECK-SAME: (double nofpclass(ninf nzero nsub nnorm) [[ARG0:%.*]]) #[[ATTR1]] {
139 ; CHECK-NEXT: [[EXT:%.*]] = fptrunc double [[ARG0]] to float
140 ; CHECK-NEXT: ret float [[EXT]]
142 %ext = fptrunc double %arg0 to float
146 define float @ret_fptrunc_posonly_zero(double nofpclass(ninf nnorm nsub) %arg0) {
147 ; CHECK-LABEL: define nofpclass(ninf nsub nnorm) float @ret_fptrunc_posonly_zero
148 ; CHECK-SAME: (double nofpclass(ninf nsub nnorm) [[ARG0:%.*]]) #[[ATTR1]] {
149 ; CHECK-NEXT: [[EXT:%.*]] = fptrunc double [[ARG0]] to float
150 ; CHECK-NEXT: ret float [[EXT]]
152 %ext = fptrunc double %arg0 to float
156 define float @ret_fptrunc_posonly_zero_nan(double nofpclass(ninf nnorm nsub nan) %arg0) {
157 ; CHECK-LABEL: define nofpclass(nan ninf nsub nnorm) float @ret_fptrunc_posonly_zero_nan
158 ; CHECK-SAME: (double nofpclass(nan ninf nsub nnorm) [[ARG0:%.*]]) #[[ATTR1]] {
159 ; CHECK-NEXT: [[EXT:%.*]] = fptrunc double [[ARG0]] to float
160 ; CHECK-NEXT: ret float [[EXT]]
162 %ext = fptrunc double %arg0 to float
166 define float @ret_fptrunc_posonly_nan(double nofpclass(ninf nnorm nsub nzero nan) %arg0) {
167 ; CHECK-LABEL: define nofpclass(nan ninf nsub nnorm) float @ret_fptrunc_posonly_nan
168 ; CHECK-SAME: (double nofpclass(nan ninf nzero nsub nnorm) [[ARG0:%.*]]) #[[ATTR1]] {
169 ; CHECK-NEXT: [[EXT:%.*]] = fptrunc double [[ARG0]] to float
170 ; CHECK-NEXT: ret float [[EXT]]
172 %ext = fptrunc double %arg0 to float
176 define float @ret_fptrunc_negonly(double nofpclass(pinf pnorm psub pzero) %arg0) {
177 ; CHECK-LABEL: define float @ret_fptrunc_negonly
178 ; CHECK-SAME: (double nofpclass(pinf pzero psub pnorm) [[ARG0:%.*]]) #[[ATTR1]] {
179 ; CHECK-NEXT: [[EXT:%.*]] = fptrunc double [[ARG0]] to float
180 ; CHECK-NEXT: ret float [[EXT]]
182 %ext = fptrunc double %arg0 to float
186 define float @ret_fptrunc_negonly_zero(double nofpclass(pinf pnorm psub) %arg0) {
187 ; CHECK-LABEL: define float @ret_fptrunc_negonly_zero
188 ; CHECK-SAME: (double nofpclass(pinf psub pnorm) [[ARG0:%.*]]) #[[ATTR1]] {
189 ; CHECK-NEXT: [[EXT:%.*]] = fptrunc double [[ARG0]] to float
190 ; CHECK-NEXT: ret float [[EXT]]
192 %ext = fptrunc double %arg0 to float
196 define float @ret_fptrunc_negonly_zero_nan(double nofpclass(pinf pnorm psub nan) %arg0) {
197 ; CHECK-LABEL: define nofpclass(nan) float @ret_fptrunc_negonly_zero_nan
198 ; CHECK-SAME: (double nofpclass(nan pinf psub pnorm) [[ARG0:%.*]]) #[[ATTR1]] {
199 ; CHECK-NEXT: [[EXT:%.*]] = fptrunc double [[ARG0]] to float
200 ; CHECK-NEXT: ret float [[EXT]]
202 %ext = fptrunc double %arg0 to float
206 define float @ret_fptrunc_round(double %arg0) {
207 ; CHECK-LABEL: define float @ret_fptrunc_round
208 ; CHECK-SAME: (double [[ARG0:%.*]]) #[[ATTR1]] {
209 ; CHECK-NEXT: [[EXT:%.*]] = call float @llvm.fptrunc.round.f32.f64(double [[ARG0]], metadata !"round.downward") #[[ATTR2:[0-9]+]]
210 ; CHECK-NEXT: ret float [[EXT]]
212 %ext = call float @llvm.fptrunc.round.f32.f64(double %arg0, metadata !"round.downward")
216 define float @ret_fptrunc_round_nonan(double nofpclass(nan) %arg0) {
217 ; CHECK-LABEL: define nofpclass(nan) float @ret_fptrunc_round_nonan
218 ; CHECK-SAME: (double nofpclass(nan) [[ARG0:%.*]]) #[[ATTR1]] {
219 ; CHECK-NEXT: [[EXT:%.*]] = call nofpclass(nan) float @llvm.fptrunc.round.f32.f64(double nofpclass(nan) [[ARG0]], metadata !"round.downward") #[[ATTR2]]
220 ; CHECK-NEXT: ret float [[EXT]]
222 %ext = call float @llvm.fptrunc.round.f32.f64(double %arg0, metadata !"round.downward")
226 define float @ret_fptrunc_round_noqnan(double nofpclass(qnan) %arg0) {
227 ; CHECK-LABEL: define float @ret_fptrunc_round_noqnan
228 ; CHECK-SAME: (double nofpclass(qnan) [[ARG0:%.*]]) #[[ATTR1]] {
229 ; CHECK-NEXT: [[EXT:%.*]] = call float @llvm.fptrunc.round.f32.f64(double nofpclass(qnan) [[ARG0]], metadata !"round.downward") #[[ATTR2]]
230 ; CHECK-NEXT: ret float [[EXT]]
232 %ext = call float @llvm.fptrunc.round.f32.f64(double %arg0, metadata !"round.downward")
236 define float @ret_fptrunc_round_nosnan(double nofpclass(snan) %arg0) {
237 ; CHECK-LABEL: define nofpclass(snan) float @ret_fptrunc_round_nosnan
238 ; CHECK-SAME: (double nofpclass(snan) [[ARG0:%.*]]) #[[ATTR1]] {
239 ; CHECK-NEXT: [[EXT:%.*]] = call nofpclass(snan) float @llvm.fptrunc.round.f32.f64(double nofpclass(snan) [[ARG0]], metadata !"round.downward") #[[ATTR2]]
240 ; CHECK-NEXT: ret float [[EXT]]
242 %ext = call float @llvm.fptrunc.round.f32.f64(double %arg0, metadata !"round.downward")
246 define float @ret_fptrunc_round_noinf(double nofpclass(inf) %arg0) {
247 ; CHECK-LABEL: define float @ret_fptrunc_round_noinf
248 ; CHECK-SAME: (double nofpclass(inf) [[ARG0:%.*]]) #[[ATTR1]] {
249 ; CHECK-NEXT: [[EXT:%.*]] = call float @llvm.fptrunc.round.f32.f64(double nofpclass(inf) [[ARG0]], metadata !"round.downward") #[[ATTR2]]
250 ; CHECK-NEXT: ret float [[EXT]]
252 %ext = call float @llvm.fptrunc.round.f32.f64(double %arg0, metadata !"round.downward")
256 define float @ret_fptrunc_round_nopinf(double nofpclass(pinf) %arg0) {
257 ; CHECK-LABEL: define float @ret_fptrunc_round_nopinf
258 ; CHECK-SAME: (double nofpclass(pinf) [[ARG0:%.*]]) #[[ATTR1]] {
259 ; CHECK-NEXT: [[EXT:%.*]] = call float @llvm.fptrunc.round.f32.f64(double nofpclass(pinf) [[ARG0]], metadata !"round.downward") #[[ATTR2]]
260 ; CHECK-NEXT: ret float [[EXT]]
262 %ext = call float @llvm.fptrunc.round.f32.f64(double %arg0, metadata !"round.downward")
266 define float @ret_fptrunc_round_noninf(double nofpclass(ninf) %arg0) {
267 ; CHECK-LABEL: define float @ret_fptrunc_round_noninf
268 ; CHECK-SAME: (double nofpclass(ninf) [[ARG0:%.*]]) #[[ATTR1]] {
269 ; CHECK-NEXT: [[EXT:%.*]] = call float @llvm.fptrunc.round.f32.f64(double nofpclass(ninf) [[ARG0]], metadata !"round.downward") #[[ATTR2]]
270 ; CHECK-NEXT: ret float [[EXT]]
272 %ext = call float @llvm.fptrunc.round.f32.f64(double %arg0, metadata !"round.downward")
276 define float @ret_fptrunc_round_nozero(double nofpclass(zero) %arg0) {
277 ; CHECK-LABEL: define float @ret_fptrunc_round_nozero
278 ; CHECK-SAME: (double nofpclass(zero) [[ARG0:%.*]]) #[[ATTR1]] {
279 ; CHECK-NEXT: [[EXT:%.*]] = call float @llvm.fptrunc.round.f32.f64(double nofpclass(zero) [[ARG0]], metadata !"round.downward") #[[ATTR2]]
280 ; CHECK-NEXT: ret float [[EXT]]
282 %ext = call float @llvm.fptrunc.round.f32.f64(double %arg0, metadata !"round.downward")
286 define float @ret_fptrunc_round_nopzero(double nofpclass(pzero) %arg0) {
287 ; CHECK-LABEL: define float @ret_fptrunc_round_nopzero
288 ; CHECK-SAME: (double nofpclass(pzero) [[ARG0:%.*]]) #[[ATTR1]] {
289 ; CHECK-NEXT: [[EXT:%.*]] = call float @llvm.fptrunc.round.f32.f64(double nofpclass(pzero) [[ARG0]], metadata !"round.downward") #[[ATTR2]]
290 ; CHECK-NEXT: ret float [[EXT]]
292 %ext = call float @llvm.fptrunc.round.f32.f64(double %arg0, metadata !"round.downward")
296 define float @ret_fptrunc_round_nonzero(double nofpclass(nzero) %arg0) {
297 ; CHECK-LABEL: define float @ret_fptrunc_round_nonzero
298 ; CHECK-SAME: (double nofpclass(nzero) [[ARG0:%.*]]) #[[ATTR1]] {
299 ; CHECK-NEXT: [[EXT:%.*]] = call float @llvm.fptrunc.round.f32.f64(double nofpclass(nzero) [[ARG0]], metadata !"round.downward") #[[ATTR2]]
300 ; CHECK-NEXT: ret float [[EXT]]
302 %ext = call float @llvm.fptrunc.round.f32.f64(double %arg0, metadata !"round.downward")
306 define float @ret_fptrunc_round_nonan_noinf(double nofpclass(nan inf) %arg0) {
307 ; CHECK-LABEL: define nofpclass(nan) float @ret_fptrunc_round_nonan_noinf
308 ; CHECK-SAME: (double nofpclass(nan inf) [[ARG0:%.*]]) #[[ATTR1]] {
309 ; CHECK-NEXT: [[EXT:%.*]] = call nofpclass(nan) float @llvm.fptrunc.round.f32.f64(double nofpclass(nan inf) [[ARG0]], metadata !"round.downward") #[[ATTR2]]
310 ; CHECK-NEXT: ret float [[EXT]]
312 %ext = call float @llvm.fptrunc.round.f32.f64(double %arg0, metadata !"round.downward")
316 define float @ret_fptrunc_round_nosub(double nofpclass(sub) %arg0) {
317 ; CHECK-LABEL: define float @ret_fptrunc_round_nosub
318 ; CHECK-SAME: (double nofpclass(sub) [[ARG0:%.*]]) #[[ATTR1]] {
319 ; CHECK-NEXT: [[EXT:%.*]] = call float @llvm.fptrunc.round.f32.f64(double nofpclass(sub) [[ARG0]], metadata !"round.downward") #[[ATTR2]]
320 ; CHECK-NEXT: ret float [[EXT]]
322 %ext = call float @llvm.fptrunc.round.f32.f64(double %arg0, metadata !"round.downward")
326 define float @ret_fptrunc_round_nonorm(double nofpclass(norm) %arg0) {
327 ; CHECK-LABEL: define float @ret_fptrunc_round_nonorm
328 ; CHECK-SAME: (double nofpclass(norm) [[ARG0:%.*]]) #[[ATTR1]] {
329 ; CHECK-NEXT: [[EXT:%.*]] = call float @llvm.fptrunc.round.f32.f64(double nofpclass(norm) [[ARG0]], metadata !"round.downward") #[[ATTR2]]
330 ; CHECK-NEXT: ret float [[EXT]]
332 %ext = call float @llvm.fptrunc.round.f32.f64(double %arg0, metadata !"round.downward")
336 ;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line: