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.powi.f32.i32(float, i32)
5 declare float @llvm.powi.f32.i64(float, i64)
7 declare <2 x float> @llvm.powi.v2f32.v2i32(<2 x float>, <2 x i32>)
8 declare <4 x float> @llvm.powi.v4f32.i32(<4 x float>, i32)
10 define float @ret_powi_f32(float %arg0, i32 %arg1) #0 {
11 ; CHECK-LABEL: define float @ret_powi_f32
12 ; CHECK-SAME: (float [[ARG0:%.*]], i32 [[ARG1:%.*]]) #[[ATTR1:[0-9]+]] {
13 ; CHECK-NEXT: [[CALL:%.*]] = call float @llvm.powi.f32.i32(float [[ARG0]], i32 [[ARG1]]) #[[ATTR6:[0-9]+]]
14 ; CHECK-NEXT: ret float [[CALL]]
16 %call = call float @llvm.powi.f32.i32(float %arg0, i32 %arg1)
20 define float @ret_powi_f32_i64(float %arg0, i64 %arg1) #0 {
21 ; CHECK-LABEL: define float @ret_powi_f32_i64
22 ; CHECK-SAME: (float [[ARG0:%.*]], i64 [[ARG1:%.*]]) #[[ATTR1]] {
23 ; CHECK-NEXT: [[CALL:%.*]] = call float @llvm.powi.f32.i64(float [[ARG0]], i64 [[ARG1]]) #[[ATTR6]]
24 ; CHECK-NEXT: ret float [[CALL]]
26 %call = call float @llvm.powi.f32.i64(float %arg0, i64 %arg1)
30 define <2 x float> @ret_powi_v2f32(<2 x float> %arg0, <2 x i32> %arg1) #0 {
31 ; CHECK-LABEL: define <2 x float> @ret_powi_v2f32
32 ; CHECK-SAME: (<2 x float> [[ARG0:%.*]], <2 x i32> [[ARG1:%.*]]) #[[ATTR1]] {
33 ; CHECK-NEXT: [[CALL:%.*]] = call <2 x float> @llvm.powi.v2f32.v2i32(<2 x float> [[ARG0]], <2 x i32> [[ARG1]]) #[[ATTR6]]
34 ; CHECK-NEXT: ret <2 x float> [[CALL]]
36 %call = call <2 x float> @llvm.powi.v2f32.v2i32(<2 x float> %arg0, <2 x i32> %arg1)
40 define float @ret_powi_f32_odd_constant(float %arg0) #0 {
41 ; CHECK-LABEL: define float @ret_powi_f32_odd_constant
42 ; CHECK-SAME: (float [[ARG0:%.*]]) #[[ATTR1]] {
43 ; CHECK-NEXT: [[CALL:%.*]] = call float @llvm.powi.f32.i32(float [[ARG0]], i32 noundef 3) #[[ATTR6]]
44 ; CHECK-NEXT: ret float [[CALL]]
46 %call = call float @llvm.powi.f32.i32(float %arg0, i32 3)
50 define float @ret_powi_f32_even_constant(float %arg0) #0 {
51 ; CHECK-LABEL: define nofpclass(ninf nzero nsub nnorm) float @ret_powi_f32_even_constant
52 ; CHECK-SAME: (float nofpclass(ninf nzero nsub nnorm) [[ARG0:%.*]]) #[[ATTR1]] {
53 ; CHECK-NEXT: [[CALL:%.*]] = call nofpclass(ninf nzero nsub nnorm) float @llvm.powi.f32.i32(float [[ARG0]], i32 noundef 4) #[[ATTR6]]
54 ; CHECK-NEXT: ret float [[CALL]]
56 %call = call float @llvm.powi.f32.i32(float %arg0, i32 4)
60 define <2 x float> @ret_powi_v2f32_even_nonsplat(<2 x float> %arg0) #0 {
61 ; CHECK-LABEL: define nofpclass(ninf nzero nsub nnorm) <2 x float> @ret_powi_v2f32_even_nonsplat
62 ; CHECK-SAME: (<2 x float> nofpclass(ninf nzero nsub nnorm) [[ARG0:%.*]]) #[[ATTR1]] {
63 ; CHECK-NEXT: [[CALL:%.*]] = call nofpclass(ninf nzero nsub nnorm) <2 x float> @llvm.powi.v2f32.v2i32(<2 x float> [[ARG0]], <2 x i32> noundef <i32 2, i32 4>) #[[ATTR6]]
64 ; CHECK-NEXT: ret <2 x float> [[CALL]]
66 %call = call <2 x float> @llvm.powi.v2f32.v2i32(<2 x float> %arg0, <2 x i32> <i32 2, i32 4>)
70 define <2 x float> @ret_powi_v2f32_odd_nonsplat(<2 x float> %arg0) #0 {
71 ; CHECK-LABEL: define <2 x float> @ret_powi_v2f32_odd_nonsplat
72 ; CHECK-SAME: (<2 x float> [[ARG0:%.*]]) #[[ATTR1]] {
73 ; CHECK-NEXT: [[CALL:%.*]] = call <2 x float> @llvm.powi.v2f32.v2i32(<2 x float> [[ARG0]], <2 x i32> noundef <i32 3, i32 4>) #[[ATTR6]]
74 ; CHECK-NEXT: ret <2 x float> [[CALL]]
76 %call = call <2 x float> @llvm.powi.v2f32.v2i32(<2 x float> %arg0, <2 x i32> <i32 3, i32 4>)
80 define float @ret_powi_f32_masked_to_even(float %arg0, i32 %arg1) #0 {
81 ; CHECK-LABEL: define nofpclass(ninf nzero nsub nnorm) float @ret_powi_f32_masked_to_even
82 ; CHECK-SAME: (float nofpclass(ninf nzero nsub nnorm) [[ARG0:%.*]], i32 [[ARG1:%.*]]) #[[ATTR1]] {
83 ; CHECK-NEXT: [[KNOWN_EVEN:%.*]] = and i32 [[ARG1]], -2
84 ; CHECK-NEXT: [[CALL:%.*]] = call nofpclass(ninf nzero nsub nnorm) float @llvm.powi.f32.i32(float [[ARG0]], i32 [[KNOWN_EVEN]]) #[[ATTR6]]
85 ; CHECK-NEXT: ret float [[CALL]]
87 %known.even = and i32 %arg1, -2
88 %call = call float @llvm.powi.f32.i32(float %arg0, i32 %known.even)
92 define float @ret_powi_f32_masked_to_even_extrabits(float %arg0, i32 %arg1) #0 {
93 ; CHECK-LABEL: define nofpclass(ninf nzero nsub nnorm) float @ret_powi_f32_masked_to_even_extrabits
94 ; CHECK-SAME: (float nofpclass(ninf nzero nsub nnorm) [[ARG0:%.*]], i32 [[ARG1:%.*]]) #[[ATTR1]] {
95 ; CHECK-NEXT: [[KNOWN_EVEN:%.*]] = and i32 [[ARG1]], -4
96 ; CHECK-NEXT: [[CALL:%.*]] = call nofpclass(ninf nzero nsub nnorm) float @llvm.powi.f32.i32(float [[ARG0]], i32 [[KNOWN_EVEN]]) #[[ATTR6]]
97 ; CHECK-NEXT: ret float [[CALL]]
99 %known.even = and i32 %arg1, -4
100 %call = call float @llvm.powi.f32.i32(float %arg0, i32 %known.even)
104 define <2 x float> @ret_powi_v2f32_masked_to_even(<2 x float> %arg0, <2 x i32> %arg1) #0 {
105 ; CHECK-LABEL: define nofpclass(ninf nzero nsub nnorm) <2 x float> @ret_powi_v2f32_masked_to_even
106 ; CHECK-SAME: (<2 x float> nofpclass(ninf nzero nsub nnorm) [[ARG0:%.*]], <2 x i32> [[ARG1:%.*]]) #[[ATTR1]] {
107 ; CHECK-NEXT: [[KNOWN_EVEN:%.*]] = and <2 x i32> [[ARG1]], <i32 -2, i32 -2>
108 ; CHECK-NEXT: [[CALL:%.*]] = call nofpclass(ninf nzero nsub nnorm) <2 x float> @llvm.powi.v2f32.v2i32(<2 x float> [[ARG0]], <2 x i32> [[KNOWN_EVEN]]) #[[ATTR6]]
109 ; CHECK-NEXT: ret <2 x float> [[CALL]]
111 %known.even = and <2 x i32> %arg1, <i32 -2, i32 -2>
112 %call = call <2 x float> @llvm.powi.v2f32.v2i32(<2 x float> %arg0, <2 x i32> %known.even)
113 ret <2 x float> %call
116 define float @ret_powi_f32_noneg(float nofpclass(ninf nsub nnorm) %arg0, i32 %arg1) #0 {
117 ; CHECK-LABEL: define float @ret_powi_f32_noneg
118 ; CHECK-SAME: (float nofpclass(ninf nsub nnorm) [[ARG0:%.*]], i32 [[ARG1:%.*]]) #[[ATTR1]] {
119 ; CHECK-NEXT: [[CALL:%.*]] = call float @llvm.powi.f32.i32(float [[ARG0]], i32 [[ARG1]]) #[[ATTR6]]
120 ; CHECK-NEXT: ret float [[CALL]]
122 %call = call float @llvm.powi.f32.i32(float %arg0, i32 %arg1)
126 define float @ret_powi_f32_noneg_nonzero(float nofpclass(ninf nsub nnorm nzero) %arg0, i32 %arg1) #0 {
127 ; CHECK-LABEL: define nofpclass(ninf nzero nsub nnorm) float @ret_powi_f32_noneg_nonzero
128 ; CHECK-SAME: (float nofpclass(ninf nzero nsub nnorm) [[ARG0:%.*]], i32 [[ARG1:%.*]]) #[[ATTR1]] {
129 ; CHECK-NEXT: [[CALL:%.*]] = call nofpclass(ninf nzero nsub nnorm) float @llvm.powi.f32.i32(float [[ARG0]], i32 [[ARG1]]) #[[ATTR6]]
130 ; CHECK-NEXT: ret float [[CALL]]
132 %call = call float @llvm.powi.f32.i32(float %arg0, i32 %arg1)
136 define float @ret_powi_f32_noneg_nozero(float nofpclass(ninf nsub nnorm) %arg0, i32 %arg1) #0 {
137 ; CHECK-LABEL: define float @ret_powi_f32_noneg_nozero
138 ; CHECK-SAME: (float nofpclass(ninf nsub nnorm) [[ARG0:%.*]], i32 [[ARG1:%.*]]) #[[ATTR1]] {
139 ; CHECK-NEXT: [[CALL:%.*]] = call float @llvm.powi.f32.i32(float [[ARG0]], i32 [[ARG1]]) #[[ATTR6]]
140 ; CHECK-NEXT: ret float [[CALL]]
142 %call = call float @llvm.powi.f32.i32(float %arg0, i32 %arg1)
146 define float @ret_powi_f32_nonzero(float nofpclass(nzero) %arg0, i32 %arg1) #0 {
147 ; CHECK-LABEL: define float @ret_powi_f32_nonzero
148 ; CHECK-SAME: (float nofpclass(nzero) [[ARG0:%.*]], i32 [[ARG1:%.*]]) #[[ATTR1]] {
149 ; CHECK-NEXT: [[CALL:%.*]] = call float @llvm.powi.f32.i32(float [[ARG0]], i32 [[ARG1]]) #[[ATTR6]]
150 ; CHECK-NEXT: ret float [[CALL]]
152 %call = call float @llvm.powi.f32.i32(float %arg0, i32 %arg1)
156 define float @ret_powi_f32_nopzero(float nofpclass(pzero) %arg0, i32 %arg1) #0 {
157 ; CHECK-LABEL: define float @ret_powi_f32_nopzero
158 ; CHECK-SAME: (float nofpclass(pzero) [[ARG0:%.*]], i32 [[ARG1:%.*]]) #[[ATTR1]] {
159 ; CHECK-NEXT: [[CALL:%.*]] = call float @llvm.powi.f32.i32(float [[ARG0]], i32 [[ARG1]]) #[[ATTR6]]
160 ; CHECK-NEXT: ret float [[CALL]]
162 %call = call float @llvm.powi.f32.i32(float %arg0, i32 %arg1)
166 define float @ret_powi_f32_noneg_ftz_daz(float nofpclass(ninf nsub nnorm) %arg0, i32 %arg1) #1 {
167 ; CHECK-LABEL: define float @ret_powi_f32_noneg_ftz_daz
168 ; CHECK-SAME: (float nofpclass(ninf nsub nnorm) [[ARG0:%.*]], i32 [[ARG1:%.*]]) #[[ATTR2:[0-9]+]] {
169 ; CHECK-NEXT: [[CALL:%.*]] = call float @llvm.powi.f32.i32(float [[ARG0]], i32 [[ARG1]]) #[[ATTR6]]
170 ; CHECK-NEXT: ret float [[CALL]]
172 %call = call float @llvm.powi.f32.i32(float %arg0, i32 %arg1)
176 define float @ret_powi_f32_noneg_nonzero_ftz_daz(float nofpclass(ninf nsub nnorm nzero) %arg0, i32 %arg1) #1 {
177 ; CHECK-LABEL: define nofpclass(ninf nzero nsub nnorm) float @ret_powi_f32_noneg_nonzero_ftz_daz
178 ; CHECK-SAME: (float nofpclass(ninf nzero nsub nnorm) [[ARG0:%.*]], i32 [[ARG1:%.*]]) #[[ATTR2]] {
179 ; CHECK-NEXT: [[CALL:%.*]] = call nofpclass(ninf nzero nsub nnorm) float @llvm.powi.f32.i32(float [[ARG0]], i32 [[ARG1]]) #[[ATTR6]]
180 ; CHECK-NEXT: ret float [[CALL]]
182 %call = call float @llvm.powi.f32.i32(float %arg0, i32 %arg1)
186 define float @ret_powi_f32_noneg_nonzero_ftpz_dapz(float nofpclass(ninf nsub nnorm nzero) %arg0, i32 %arg1) #2 {
187 ; CHECK-LABEL: define nofpclass(ninf nzero nsub nnorm) float @ret_powi_f32_noneg_nonzero_ftpz_dapz
188 ; CHECK-SAME: (float nofpclass(ninf nzero nsub nnorm) [[ARG0:%.*]], i32 [[ARG1:%.*]]) #[[ATTR3:[0-9]+]] {
189 ; CHECK-NEXT: [[CALL:%.*]] = call nofpclass(ninf nzero nsub nnorm) float @llvm.powi.f32.i32(float [[ARG0]], i32 [[ARG1]]) #[[ATTR6]]
190 ; CHECK-NEXT: ret float [[CALL]]
192 %call = call float @llvm.powi.f32.i32(float %arg0, i32 %arg1)
196 define float @ret_powi_f32_noninf_nonnorm(float nofpclass(ninf nnorm) %arg0, i32 %arg1) #0 {
197 ; CHECK-LABEL: define float @ret_powi_f32_noninf_nonnorm
198 ; CHECK-SAME: (float nofpclass(ninf nnorm) [[ARG0:%.*]], i32 [[ARG1:%.*]]) #[[ATTR1]] {
199 ; CHECK-NEXT: [[CALL:%.*]] = call float @llvm.powi.f32.i32(float [[ARG0]], i32 [[ARG1]]) #[[ATTR6]]
200 ; CHECK-NEXT: ret float [[CALL]]
202 %call = call float @llvm.powi.f32.i32(float %arg0, i32 %arg1)
206 define float @ret_powi_f32_noninf_nonnorm_ftz_daz(float nofpclass(ninf nnorm) %arg0, i32 %arg1) #1 {
207 ; CHECK-LABEL: define float @ret_powi_f32_noninf_nonnorm_ftz_daz
208 ; CHECK-SAME: (float nofpclass(ninf nnorm) [[ARG0:%.*]], i32 [[ARG1:%.*]]) #[[ATTR2]] {
209 ; CHECK-NEXT: [[CALL:%.*]] = call float @llvm.powi.f32.i32(float [[ARG0]], i32 [[ARG1]]) #[[ATTR6]]
210 ; CHECK-NEXT: ret float [[CALL]]
212 %call = call float @llvm.powi.f32.i32(float %arg0, i32 %arg1)
216 define float @ret_powi_f32_noneg_ftz_ieee(float nofpclass(ninf nsub nnorm) %arg0, i32 %arg1) #3 {
217 ; CHECK-LABEL: define float @ret_powi_f32_noneg_ftz_ieee
218 ; CHECK-SAME: (float nofpclass(ninf nsub nnorm) [[ARG0:%.*]], i32 [[ARG1:%.*]]) #[[ATTR4:[0-9]+]] {
219 ; CHECK-NEXT: [[CALL:%.*]] = call float @llvm.powi.f32.i32(float [[ARG0]], i32 [[ARG1]]) #[[ATTR6]]
220 ; CHECK-NEXT: ret float [[CALL]]
222 %call = call float @llvm.powi.f32.i32(float %arg0, i32 %arg1)
226 define float @ret_powi_f32_noneg_nonzero_ftz_ieee(float nofpclass(ninf nsub nnorm nzero) %arg0, i32 %arg1) #3 {
227 ; CHECK-LABEL: define nofpclass(ninf nzero nsub nnorm) float @ret_powi_f32_noneg_nonzero_ftz_ieee
228 ; CHECK-SAME: (float nofpclass(ninf nzero nsub nnorm) [[ARG0:%.*]], i32 [[ARG1:%.*]]) #[[ATTR4]] {
229 ; CHECK-NEXT: [[CALL:%.*]] = call nofpclass(ninf nzero nsub nnorm) float @llvm.powi.f32.i32(float [[ARG0]], i32 [[ARG1]]) #[[ATTR6]]
230 ; CHECK-NEXT: ret float [[CALL]]
232 %call = call float @llvm.powi.f32.i32(float %arg0, i32 %arg1)
236 define <4 x float> @powi_v4f32_i32(<4 x float> %arg0, i32 %arg1) {
237 ; CHECK-LABEL: define <4 x float> @powi_v4f32_i32
238 ; CHECK-SAME: (<4 x float> [[ARG0:%.*]], i32 [[ARG1:%.*]]) #[[ATTR5:[0-9]+]] {
239 ; CHECK-NEXT: [[POWI:%.*]] = call <4 x float> @llvm.powi.v4f32.i32(<4 x float> [[ARG0]], i32 [[ARG1]]) #[[ATTR6]]
240 ; CHECK-NEXT: ret <4 x float> [[POWI]]
242 %powi = call <4 x float> @llvm.powi.v4f32.i32(<4 x float> %arg0, i32 %arg1)
243 ret <4 x float> %powi
246 define <4 x float> @powi_v4f32_i32_nozero(<4 x float> nofpclass(zero) %arg0, i32 %arg1) {
247 ; CHECK-LABEL: define <4 x float> @powi_v4f32_i32_nozero
248 ; CHECK-SAME: (<4 x float> nofpclass(zero) [[ARG0:%.*]], i32 [[ARG1:%.*]]) #[[ATTR5]] {
249 ; CHECK-NEXT: [[POWI:%.*]] = call <4 x float> @llvm.powi.v4f32.i32(<4 x float> [[ARG0]], i32 [[ARG1]]) #[[ATTR6]]
250 ; CHECK-NEXT: ret <4 x float> [[POWI]]
252 %powi = call <4 x float> @llvm.powi.v4f32.i32(<4 x float> %arg0, i32 %arg1)
253 ret <4 x float> %powi
256 define <4 x float> @powi_v4f32_i32_constint_even(<4 x float> %arg) {
257 ; CHECK-LABEL: define nofpclass(ninf nzero nsub nnorm) <4 x float> @powi_v4f32_i32_constint_even
258 ; CHECK-SAME: (<4 x float> nofpclass(ninf nzero nsub nnorm) [[ARG:%.*]]) #[[ATTR5]] {
259 ; CHECK-NEXT: [[POWI:%.*]] = call nofpclass(ninf nzero nsub nnorm) <4 x float> @llvm.powi.v4f32.i32(<4 x float> [[ARG]], i32 noundef 4) #[[ATTR6]]
260 ; CHECK-NEXT: ret <4 x float> [[POWI]]
262 %powi = call <4 x float> @llvm.powi.v4f32.i32(<4 x float> %arg, i32 4)
263 ret <4 x float> %powi
266 define <4 x float> @powi_v4f32_i32_constint_odd(<4 x float> %arg) {
267 ; CHECK-LABEL: define <4 x float> @powi_v4f32_i32_constint_odd
268 ; CHECK-SAME: (<4 x float> [[ARG:%.*]]) #[[ATTR5]] {
269 ; CHECK-NEXT: [[POWI:%.*]] = call <4 x float> @llvm.powi.v4f32.i32(<4 x float> [[ARG]], i32 noundef 3) #[[ATTR6]]
270 ; CHECK-NEXT: ret <4 x float> [[POWI]]
272 %powi = call <4 x float> @llvm.powi.v4f32.i32(<4 x float> %arg, i32 3)
273 ret <4 x float> %powi
276 define <4 x float> @powi_v4f32_i32_regression(<4 x float> %arg) {
277 ; CHECK-LABEL: define nofpclass(nzero) <4 x float> @powi_v4f32_i32_regression
278 ; CHECK-SAME: (<4 x float> nofpclass(ninf nzero nsub nnorm) [[ARG:%.*]]) #[[ATTR5]] {
279 ; CHECK-NEXT: [[POWI:%.*]] = call <4 x float> @llvm.powi.v4f32.i32(<4 x float> [[ARG]], i32 noundef 4) #[[ATTR6]]
280 ; CHECK-NEXT: [[USER:%.*]] = fsub <4 x float> [[POWI]], <float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00>
281 ; CHECK-NEXT: ret <4 x float> [[USER]]
283 %powi = call <4 x float> @llvm.powi.v4f32.i32(<4 x float> %arg, i32 4)
284 %user = fsub <4 x float> %powi, <float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00>
285 ret <4 x float> %user
288 attributes #0 = { "denormal-fp-math"="ieee,ieee" }
289 attributes #1 = { "denormal-fp-math"="preserve-sign,preserve-sign" }
290 attributes #2 = { "denormal-fp-math"="positive-zero,positive-zero" }
291 attributes #3 = { "denormal-fp-math"="preserve-sign,ieee" }
293 ;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line: