xref: /llvm-project/llvm/test/CodeGen/AMDGPU/amdgpu-simplify-libcall-pow.ll (revision 38fffa630ee80163dc65e759392ad29798905679)
1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 2
2; RUN: opt -S -mtriple=amdgcn-amd-amdhsa -passes=amdgpu-simplifylib,instcombine -amdgpu-prelink %s | FileCheck %s
3
4target datalayout = "e-p:64:64-p1:64:64-p2:32:32-p3:32:32-p4:64:64-p5:32:32-p6:32:32-p7:160:256:256:32-p8:128:128-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024-v2048:2048-n32:64-S32-A5-G1-ni:7:8:9"
5
6declare float @_Z3powff(float, float)
7declare <2 x float> @_Z3powDv2_fS_(<2 x float>, <2 x float>)
8declare <3 x float> @_Z3powDv3_fS_(<3 x float>, <3 x float>)
9declare <4 x float> @_Z3powDv4_fS_(<4 x float>, <4 x float>)
10declare <8 x float> @_Z3powDv8_fS_(<8 x float>, <8 x float>)
11declare <16 x float> @_Z3powDv16_fS_(<16 x float>, <16 x float>)
12declare double @_Z3powdd(double, double)
13declare <2 x double> @_Z3powDv2_dS_(<2 x double>, <2 x double>)
14declare <3 x double> @_Z3powDv3_dS_(<3 x double>, <3 x double>)
15declare <4 x double> @_Z3powDv4_dS_(<4 x double>, <4 x double>)
16declare <8 x double> @_Z3powDv8_dS_(<8 x double>, <8 x double>)
17declare <16 x double> @_Z3powDv16_dS_(<16 x double>, <16 x double>)
18declare half @_Z3powDhDh(half, half)
19declare <2 x half> @_Z3powDv2_DhS_(<2 x half>, <2 x half>)
20declare <3 x half> @_Z3powDv3_DhS_(<3 x half>, <3 x half>)
21declare <4 x half> @_Z3powDv4_DhS_(<4 x half>, <4 x half>)
22declare <8 x half> @_Z3powDv8_DhS_(<8 x half>, <8 x half>)
23declare <16 x half> @_Z3powDv16_DhS_(<16 x half>, <16 x half>)
24declare void @llvm.assume(i1 noundef)
25declare float @llvm.floor.f32(float)
26declare float @llvm.ceil.f32(float)
27declare float @llvm.trunc.f32(float)
28declare float @llvm.rint.f32(float)
29declare float @llvm.nearbyint.f32(float)
30declare float @llvm.round.f32(float)
31declare float @llvm.roundeven.f32(float)
32
33define float @test_pow_fast_f32(float %x, float %y) {
34; CHECK-LABEL: define float @test_pow_fast_f32
35; CHECK-SAME: (float [[X:%.*]], float [[Y:%.*]]) {
36; CHECK-NEXT:    [[POW:%.*]] = tail call fast float @_Z3powff(float [[X]], float [[Y]])
37; CHECK-NEXT:    ret float [[POW]]
38;
39  %pow = tail call fast float @_Z3powff(float %x, float %y)
40  ret float %pow
41}
42
43define <2 x float> @test_pow_fast_v2f32(<2 x float> %x, <2 x float> %y) {
44; CHECK-LABEL: define <2 x float> @test_pow_fast_v2f32
45; CHECK-SAME: (<2 x float> [[X:%.*]], <2 x float> [[Y:%.*]]) {
46; CHECK-NEXT:    [[POW:%.*]] = tail call fast <2 x float> @_Z3powDv2_fS_(<2 x float> [[X]], <2 x float> [[Y]])
47; CHECK-NEXT:    ret <2 x float> [[POW]]
48;
49  %pow = tail call fast <2 x float> @_Z3powDv2_fS_(<2 x float> %x, <2 x float> %y)
50  ret <2 x float> %pow
51}
52
53define float @test_pow_afn_f32_nnan(float %x, float %y) {
54; CHECK-LABEL: define float @test_pow_afn_f32_nnan
55; CHECK-SAME: (float [[X:%.*]], float [[Y:%.*]]) {
56; CHECK-NEXT:    [[POW:%.*]] = tail call nnan afn float @_Z3powff(float [[X]], float [[Y]])
57; CHECK-NEXT:    ret float [[POW]]
58;
59  %pow = tail call afn nnan float @_Z3powff(float %x, float %y)
60  ret float %pow
61}
62
63define float @test_pow_afn_f32_nnan_ninf(float %x, float %y) {
64; CHECK-LABEL: define float @test_pow_afn_f32_nnan_ninf
65; CHECK-SAME: (float [[X:%.*]], float [[Y:%.*]]) {
66; CHECK-NEXT:    [[POW:%.*]] = tail call nnan ninf afn float @_Z3powff(float [[X]], float [[Y]])
67; CHECK-NEXT:    ret float [[POW]]
68;
69  %pow = tail call afn nnan ninf float @_Z3powff(float %x, float %y)
70  ret float %pow
71}
72
73define <2 x float> @test_pow_afn_v2f32_nnan(<2 x float> %x, <2 x float> %y) {
74; CHECK-LABEL: define <2 x float> @test_pow_afn_v2f32_nnan
75; CHECK-SAME: (<2 x float> [[X:%.*]], <2 x float> [[Y:%.*]]) {
76; CHECK-NEXT:    [[POW:%.*]] = tail call nnan afn <2 x float> @_Z3powDv2_fS_(<2 x float> [[X]], <2 x float> [[Y]])
77; CHECK-NEXT:    ret <2 x float> [[POW]]
78;
79  %pow = tail call afn nnan <2 x float> @_Z3powDv2_fS_(<2 x float> %x, <2 x float> %y)
80  ret <2 x float> %pow
81}
82
83define <2 x float> @test_pow_afn_v2f32_nnan_ninf(<2 x float> %x, <2 x float> %y) {
84; CHECK-LABEL: define <2 x float> @test_pow_afn_v2f32_nnan_ninf
85; CHECK-SAME: (<2 x float> [[X:%.*]], <2 x float> [[Y:%.*]]) {
86; CHECK-NEXT:    [[POW:%.*]] = tail call nnan ninf afn <2 x float> @_Z3powDv2_fS_(<2 x float> [[X]], <2 x float> [[Y]])
87; CHECK-NEXT:    ret <2 x float> [[POW]]
88;
89  %pow = tail call afn nnan ninf <2 x float> @_Z3powDv2_fS_(<2 x float> %x, <2 x float> %y)
90  ret <2 x float> %pow
91}
92
93define float @test_pow_afn_f32(float %x, float %y) {
94; CHECK-LABEL: define float @test_pow_afn_f32
95; CHECK-SAME: (float [[X:%.*]], float [[Y:%.*]]) {
96; CHECK-NEXT:    [[POW:%.*]] = tail call afn float @_Z3powff(float [[X]], float [[Y]])
97; CHECK-NEXT:    ret float [[POW]]
98;
99  %pow = tail call afn float @_Z3powff(float %x, float %y)
100  ret float %pow
101}
102
103define <2 x float> @test_pow_afn_v2f32(<2 x float> %x, <2 x float> %y) {
104; CHECK-LABEL: define <2 x float> @test_pow_afn_v2f32
105; CHECK-SAME: (<2 x float> [[X:%.*]], <2 x float> [[Y:%.*]]) {
106; CHECK-NEXT:    [[POW:%.*]] = tail call afn <2 x float> @_Z3powDv2_fS_(<2 x float> [[X]], <2 x float> [[Y]])
107; CHECK-NEXT:    ret <2 x float> [[POW]]
108;
109  %pow = tail call afn <2 x float> @_Z3powDv2_fS_(<2 x float> %x, <2 x float> %y)
110  ret <2 x float> %pow
111}
112
113define <3 x float> @test_pow_afn_v3f32(<3 x float> %x, <3 x float> %y) {
114; CHECK-LABEL: define <3 x float> @test_pow_afn_v3f32
115; CHECK-SAME: (<3 x float> [[X:%.*]], <3 x float> [[Y:%.*]]) {
116; CHECK-NEXT:    [[POW:%.*]] = tail call afn <3 x float> @_Z3powDv3_fS_(<3 x float> [[X]], <3 x float> [[Y]])
117; CHECK-NEXT:    ret <3 x float> [[POW]]
118;
119  %pow = tail call afn <3 x float> @_Z3powDv3_fS_(<3 x float> %x, <3 x float> %y)
120  ret <3 x float> %pow
121}
122
123define <4 x float> @test_pow_afn_v4f32(<4 x float> %x, <4 x float> %y) {
124; CHECK-LABEL: define <4 x float> @test_pow_afn_v4f32
125; CHECK-SAME: (<4 x float> [[X:%.*]], <4 x float> [[Y:%.*]]) {
126; CHECK-NEXT:    [[POW:%.*]] = tail call afn <4 x float> @_Z3powDv4_fS_(<4 x float> [[X]], <4 x float> [[Y]])
127; CHECK-NEXT:    ret <4 x float> [[POW]]
128;
129  %pow = tail call afn <4 x float> @_Z3powDv4_fS_(<4 x float> %x, <4 x float> %y)
130  ret <4 x float> %pow
131}
132
133define <8 x float> @test_pow_afn_v8f32(<8 x float> %x, <8 x float> %y) {
134; CHECK-LABEL: define <8 x float> @test_pow_afn_v8f32
135; CHECK-SAME: (<8 x float> [[X:%.*]], <8 x float> [[Y:%.*]]) {
136; CHECK-NEXT:    [[POW:%.*]] = tail call afn <8 x float> @_Z3powDv8_fS_(<8 x float> [[X]], <8 x float> [[Y]])
137; CHECK-NEXT:    ret <8 x float> [[POW]]
138;
139  %pow = tail call afn <8 x float> @_Z3powDv8_fS_(<8 x float> %x, <8 x float> %y)
140  ret <8 x float> %pow
141}
142
143define <16 x float> @test_pow_afn_v16f32(<16 x float> %x, <16 x float> %y) {
144; CHECK-LABEL: define <16 x float> @test_pow_afn_v16f32
145; CHECK-SAME: (<16 x float> [[X:%.*]], <16 x float> [[Y:%.*]]) {
146; CHECK-NEXT:    [[POW:%.*]] = tail call afn <16 x float> @_Z3powDv16_fS_(<16 x float> [[X]], <16 x float> [[Y]])
147; CHECK-NEXT:    ret <16 x float> [[POW]]
148;
149  %pow = tail call afn <16 x float> @_Z3powDv16_fS_(<16 x float> %x, <16 x float> %y)
150  ret <16 x float> %pow
151}
152
153define double @test_pow_afn_f64(double %x, double %y) {
154; CHECK-LABEL: define double @test_pow_afn_f64
155; CHECK-SAME: (double [[X:%.*]], double [[Y:%.*]]) {
156; CHECK-NEXT:    [[POW:%.*]] = tail call afn double @_Z3powdd(double [[X]], double [[Y]])
157; CHECK-NEXT:    ret double [[POW]]
158;
159  %pow = tail call afn double @_Z3powdd(double %x, double %y)
160  ret double %pow
161}
162
163define <2 x double> @test_pow_afn_v2f64(<2 x double> %x, <2 x double> %y) {
164; CHECK-LABEL: define <2 x double> @test_pow_afn_v2f64
165; CHECK-SAME: (<2 x double> [[X:%.*]], <2 x double> [[Y:%.*]]) {
166; CHECK-NEXT:    [[POW:%.*]] = tail call afn <2 x double> @_Z3powDv2_dS_(<2 x double> [[X]], <2 x double> [[Y]])
167; CHECK-NEXT:    ret <2 x double> [[POW]]
168;
169  %pow = tail call afn <2 x double> @_Z3powDv2_dS_(<2 x double> %x, <2 x double> %y)
170  ret <2 x double> %pow
171}
172
173define <3 x double> @test_pow_afn_v3f64(<3 x double> %x, <3 x double> %y) {
174; CHECK-LABEL: define <3 x double> @test_pow_afn_v3f64
175; CHECK-SAME: (<3 x double> [[X:%.*]], <3 x double> [[Y:%.*]]) {
176; CHECK-NEXT:    [[POW:%.*]] = tail call afn <3 x double> @_Z3powDv3_dS_(<3 x double> [[X]], <3 x double> [[Y]])
177; CHECK-NEXT:    ret <3 x double> [[POW]]
178;
179  %pow = tail call afn <3 x double> @_Z3powDv3_dS_(<3 x double> %x, <3 x double> %y)
180  ret <3 x double> %pow
181}
182
183define <4 x double> @test_pow_afn_v4f64(<4 x double> %x, <4 x double> %y) {
184; CHECK-LABEL: define <4 x double> @test_pow_afn_v4f64
185; CHECK-SAME: (<4 x double> [[X:%.*]], <4 x double> [[Y:%.*]]) {
186; CHECK-NEXT:    [[POW:%.*]] = tail call afn <4 x double> @_Z3powDv4_dS_(<4 x double> [[X]], <4 x double> [[Y]])
187; CHECK-NEXT:    ret <4 x double> [[POW]]
188;
189  %pow = tail call afn <4 x double> @_Z3powDv4_dS_(<4 x double> %x, <4 x double> %y)
190  ret <4 x double> %pow
191}
192
193define <8 x double> @test_pow_afn_v8f64(<8 x double> %x, <8 x double> %y) {
194; CHECK-LABEL: define <8 x double> @test_pow_afn_v8f64
195; CHECK-SAME: (<8 x double> [[X:%.*]], <8 x double> [[Y:%.*]]) {
196; CHECK-NEXT:    [[POW:%.*]] = tail call afn <8 x double> @_Z3powDv8_dS_(<8 x double> [[X]], <8 x double> [[Y]])
197; CHECK-NEXT:    ret <8 x double> [[POW]]
198;
199  %pow = tail call afn <8 x double> @_Z3powDv8_dS_(<8 x double> %x, <8 x double> %y)
200  ret <8 x double> %pow
201}
202
203define <16 x double> @test_pow_afn_v16f64(<16 x double> %x, <16 x double> %y) {
204; CHECK-LABEL: define <16 x double> @test_pow_afn_v16f64
205; CHECK-SAME: (<16 x double> [[X:%.*]], <16 x double> [[Y:%.*]]) {
206; CHECK-NEXT:    [[POW:%.*]] = tail call afn <16 x double> @_Z3powDv16_dS_(<16 x double> [[X]], <16 x double> [[Y]])
207; CHECK-NEXT:    ret <16 x double> [[POW]]
208;
209  %pow = tail call afn <16 x double> @_Z3powDv16_dS_(<16 x double> %x, <16 x double> %y)
210  ret <16 x double> %pow
211}
212
213define half @test_pow_afn_f16(half %x, half %y) {
214; CHECK-LABEL: define half @test_pow_afn_f16
215; CHECK-SAME: (half [[X:%.*]], half [[Y:%.*]]) {
216; CHECK-NEXT:    [[POW:%.*]] = tail call afn half @_Z3powDhDh(half [[X]], half [[Y]])
217; CHECK-NEXT:    ret half [[POW]]
218;
219  %pow = tail call afn half @_Z3powDhDh(half %x, half %y)
220  ret half %pow
221}
222
223define <2 x half> @test_pow_afn_v2f16(<2 x half> %x, <2 x half> %y) {
224; CHECK-LABEL: define <2 x half> @test_pow_afn_v2f16
225; CHECK-SAME: (<2 x half> [[X:%.*]], <2 x half> [[Y:%.*]]) {
226; CHECK-NEXT:    [[POW:%.*]] = tail call afn <2 x half> @_Z3powDv2_DhS_(<2 x half> [[X]], <2 x half> [[Y]])
227; CHECK-NEXT:    ret <2 x half> [[POW]]
228;
229  %pow = tail call afn <2 x half> @_Z3powDv2_DhS_(<2 x half> %x, <2 x half> %y)
230  ret <2 x half> %pow
231}
232
233define <3 x half> @test_pow_afn_v3f16(<3 x half> %x, <3 x half> %y) {
234; CHECK-LABEL: define <3 x half> @test_pow_afn_v3f16
235; CHECK-SAME: (<3 x half> [[X:%.*]], <3 x half> [[Y:%.*]]) {
236; CHECK-NEXT:    [[POW:%.*]] = tail call afn <3 x half> @_Z3powDv3_DhS_(<3 x half> [[X]], <3 x half> [[Y]])
237; CHECK-NEXT:    ret <3 x half> [[POW]]
238;
239  %pow = tail call afn <3 x half> @_Z3powDv3_DhS_(<3 x half> %x, <3 x half> %y)
240  ret <3 x half> %pow
241}
242
243define <4 x half> @test_pow_afn_v4f16(<4 x half> %x, <4 x half> %y) {
244; CHECK-LABEL: define <4 x half> @test_pow_afn_v4f16
245; CHECK-SAME: (<4 x half> [[X:%.*]], <4 x half> [[Y:%.*]]) {
246; CHECK-NEXT:    [[POW:%.*]] = tail call afn <4 x half> @_Z3powDv4_DhS_(<4 x half> [[X]], <4 x half> [[Y]])
247; CHECK-NEXT:    ret <4 x half> [[POW]]
248;
249  %pow = tail call afn <4 x half> @_Z3powDv4_DhS_(<4 x half> %x, <4 x half> %y)
250  ret <4 x half> %pow
251}
252
253define <8 x half> @test_pow_afn_v8f16(<8 x half> %x, <8 x half> %y) {
254; CHECK-LABEL: define <8 x half> @test_pow_afn_v8f16
255; CHECK-SAME: (<8 x half> [[X:%.*]], <8 x half> [[Y:%.*]]) {
256; CHECK-NEXT:    [[POW:%.*]] = tail call afn <8 x half> @_Z3powDv8_DhS_(<8 x half> [[X]], <8 x half> [[Y]])
257; CHECK-NEXT:    ret <8 x half> [[POW]]
258;
259  %pow = tail call afn <8 x half> @_Z3powDv8_DhS_(<8 x half> %x, <8 x half> %y)
260  ret <8 x half> %pow
261}
262
263define <16 x half> @test_pow_afn_v16f16(<16 x half> %x, <16 x half> %y) {
264; CHECK-LABEL: define <16 x half> @test_pow_afn_v16f16
265; CHECK-SAME: (<16 x half> [[X:%.*]], <16 x half> [[Y:%.*]]) {
266; CHECK-NEXT:    [[POW:%.*]] = tail call afn <16 x half> @_Z3powDv16_DhS_(<16 x half> [[X]], <16 x half> [[Y]])
267; CHECK-NEXT:    ret <16 x half> [[POW]]
268;
269  %pow = tail call afn <16 x half> @_Z3powDv16_DhS_(<16 x half> %x, <16 x half> %y)
270  ret <16 x half> %pow
271}
272
273define float @test_pow_f32(float %x, float %y) {
274; CHECK-LABEL: define float @test_pow_f32
275; CHECK-SAME: (float [[X:%.*]], float [[Y:%.*]]) {
276; CHECK-NEXT:    [[POW:%.*]] = tail call float @_Z3powff(float [[X]], float [[Y]])
277; CHECK-NEXT:    ret float [[POW]]
278;
279  %pow = tail call float @_Z3powff(float %x, float %y)
280  ret float %pow
281}
282
283define float @test_pow_f32_nnan(float %x, float %y) {
284; CHECK-LABEL: define float @test_pow_f32_nnan
285; CHECK-SAME: (float [[X:%.*]], float [[Y:%.*]]) {
286; CHECK-NEXT:    [[POW:%.*]] = tail call nnan float @_Z3powff(float [[X]], float [[Y]])
287; CHECK-NEXT:    ret float [[POW]]
288;
289  %pow = tail call nnan float @_Z3powff(float %x, float %y)
290  ret float %pow
291}
292
293define <2 x float> @test_pow_v2f32(<2 x float> %x, <2 x float> %y) {
294; CHECK-LABEL: define <2 x float> @test_pow_v2f32
295; CHECK-SAME: (<2 x float> [[X:%.*]], <2 x float> [[Y:%.*]]) {
296; CHECK-NEXT:    [[POW:%.*]] = tail call <2 x float> @_Z3powDv2_fS_(<2 x float> [[X]], <2 x float> [[Y]])
297; CHECK-NEXT:    ret <2 x float> [[POW]]
298;
299  %pow = tail call <2 x float> @_Z3powDv2_fS_(<2 x float> %x, <2 x float> %y)
300  ret <2 x float> %pow
301}
302
303define <3 x float> @test_pow_v3f32(<3 x float> %x, <3 x float> %y) {
304; CHECK-LABEL: define <3 x float> @test_pow_v3f32
305; CHECK-SAME: (<3 x float> [[X:%.*]], <3 x float> [[Y:%.*]]) {
306; CHECK-NEXT:    [[POW:%.*]] = tail call <3 x float> @_Z3powDv3_fS_(<3 x float> [[X]], <3 x float> [[Y]])
307; CHECK-NEXT:    ret <3 x float> [[POW]]
308;
309  %pow = tail call <3 x float> @_Z3powDv3_fS_(<3 x float> %x, <3 x float> %y)
310  ret <3 x float> %pow
311}
312
313define <4 x float> @test_pow_v4f32(<4 x float> %x, <4 x float> %y) {
314; CHECK-LABEL: define <4 x float> @test_pow_v4f32
315; CHECK-SAME: (<4 x float> [[X:%.*]], <4 x float> [[Y:%.*]]) {
316; CHECK-NEXT:    [[POW:%.*]] = tail call <4 x float> @_Z3powDv4_fS_(<4 x float> [[X]], <4 x float> [[Y]])
317; CHECK-NEXT:    ret <4 x float> [[POW]]
318;
319  %pow = tail call <4 x float> @_Z3powDv4_fS_(<4 x float> %x, <4 x float> %y)
320  ret <4 x float> %pow
321}
322
323define <8 x float> @test_pow_v8f32(<8 x float> %x, <8 x float> %y) {
324; CHECK-LABEL: define <8 x float> @test_pow_v8f32
325; CHECK-SAME: (<8 x float> [[X:%.*]], <8 x float> [[Y:%.*]]) {
326; CHECK-NEXT:    [[POW:%.*]] = tail call <8 x float> @_Z3powDv8_fS_(<8 x float> [[X]], <8 x float> [[Y]])
327; CHECK-NEXT:    ret <8 x float> [[POW]]
328;
329  %pow = tail call <8 x float> @_Z3powDv8_fS_(<8 x float> %x, <8 x float> %y)
330  ret <8 x float> %pow
331}
332
333define <16 x float> @test_pow_v16f32(<16 x float> %x, <16 x float> %y) {
334; CHECK-LABEL: define <16 x float> @test_pow_v16f32
335; CHECK-SAME: (<16 x float> [[X:%.*]], <16 x float> [[Y:%.*]]) {
336; CHECK-NEXT:    [[POW:%.*]] = tail call <16 x float> @_Z3powDv16_fS_(<16 x float> [[X]], <16 x float> [[Y]])
337; CHECK-NEXT:    ret <16 x float> [[POW]]
338;
339  %pow = tail call <16 x float> @_Z3powDv16_fS_(<16 x float> %x, <16 x float> %y)
340  ret <16 x float> %pow
341}
342
343define double @test_pow_f64(double %x, double %y) {
344; CHECK-LABEL: define double @test_pow_f64
345; CHECK-SAME: (double [[X:%.*]], double [[Y:%.*]]) {
346; CHECK-NEXT:    [[POW:%.*]] = tail call double @_Z3powdd(double [[X]], double [[Y]])
347; CHECK-NEXT:    ret double [[POW]]
348;
349  %pow = tail call double @_Z3powdd(double %x, double %y)
350  ret double %pow
351}
352
353define <2 x double> @test_pow_v2f64(<2 x double> %x, <2 x double> %y) {
354; CHECK-LABEL: define <2 x double> @test_pow_v2f64
355; CHECK-SAME: (<2 x double> [[X:%.*]], <2 x double> [[Y:%.*]]) {
356; CHECK-NEXT:    [[POW:%.*]] = tail call <2 x double> @_Z3powDv2_dS_(<2 x double> [[X]], <2 x double> [[Y]])
357; CHECK-NEXT:    ret <2 x double> [[POW]]
358;
359  %pow = tail call <2 x double> @_Z3powDv2_dS_(<2 x double> %x, <2 x double> %y)
360  ret <2 x double> %pow
361}
362
363define <3 x double> @test_pow_v3f64(<3 x double> %x, <3 x double> %y) {
364; CHECK-LABEL: define <3 x double> @test_pow_v3f64
365; CHECK-SAME: (<3 x double> [[X:%.*]], <3 x double> [[Y:%.*]]) {
366; CHECK-NEXT:    [[POW:%.*]] = tail call <3 x double> @_Z3powDv3_dS_(<3 x double> [[X]], <3 x double> [[Y]])
367; CHECK-NEXT:    ret <3 x double> [[POW]]
368;
369  %pow = tail call <3 x double> @_Z3powDv3_dS_(<3 x double> %x, <3 x double> %y)
370  ret <3 x double> %pow
371}
372
373define <4 x double> @test_pow_v4f64(<4 x double> %x, <4 x double> %y) {
374; CHECK-LABEL: define <4 x double> @test_pow_v4f64
375; CHECK-SAME: (<4 x double> [[X:%.*]], <4 x double> [[Y:%.*]]) {
376; CHECK-NEXT:    [[POW:%.*]] = tail call <4 x double> @_Z3powDv4_dS_(<4 x double> [[X]], <4 x double> [[Y]])
377; CHECK-NEXT:    ret <4 x double> [[POW]]
378;
379  %pow = tail call <4 x double> @_Z3powDv4_dS_(<4 x double> %x, <4 x double> %y)
380  ret <4 x double> %pow
381}
382
383define <8 x double> @test_pow_v8f64(<8 x double> %x, <8 x double> %y) {
384; CHECK-LABEL: define <8 x double> @test_pow_v8f64
385; CHECK-SAME: (<8 x double> [[X:%.*]], <8 x double> [[Y:%.*]]) {
386; CHECK-NEXT:    [[POW:%.*]] = tail call <8 x double> @_Z3powDv8_dS_(<8 x double> [[X]], <8 x double> [[Y]])
387; CHECK-NEXT:    ret <8 x double> [[POW]]
388;
389  %pow = tail call <8 x double> @_Z3powDv8_dS_(<8 x double> %x, <8 x double> %y)
390  ret <8 x double> %pow
391}
392
393define <16 x double> @test_pow_v16f64(<16 x double> %x, <16 x double> %y) {
394; CHECK-LABEL: define <16 x double> @test_pow_v16f64
395; CHECK-SAME: (<16 x double> [[X:%.*]], <16 x double> [[Y:%.*]]) {
396; CHECK-NEXT:    [[POW:%.*]] = tail call <16 x double> @_Z3powDv16_dS_(<16 x double> [[X]], <16 x double> [[Y]])
397; CHECK-NEXT:    ret <16 x double> [[POW]]
398;
399  %pow = tail call <16 x double> @_Z3powDv16_dS_(<16 x double> %x, <16 x double> %y)
400  ret <16 x double> %pow
401}
402
403define half @test_pow_f16(half %x, half %y) {
404; CHECK-LABEL: define half @test_pow_f16
405; CHECK-SAME: (half [[X:%.*]], half [[Y:%.*]]) {
406; CHECK-NEXT:    [[POW:%.*]] = tail call half @_Z3powDhDh(half [[X]], half [[Y]])
407; CHECK-NEXT:    ret half [[POW]]
408;
409  %pow = tail call half @_Z3powDhDh(half %x, half %y)
410  ret half %pow
411}
412
413define <2 x half> @test_pow_v2f16(<2 x half> %x, <2 x half> %y) {
414; CHECK-LABEL: define <2 x half> @test_pow_v2f16
415; CHECK-SAME: (<2 x half> [[X:%.*]], <2 x half> [[Y:%.*]]) {
416; CHECK-NEXT:    [[POW:%.*]] = tail call <2 x half> @_Z3powDv2_DhS_(<2 x half> [[X]], <2 x half> [[Y]])
417; CHECK-NEXT:    ret <2 x half> [[POW]]
418;
419  %pow = tail call <2 x half> @_Z3powDv2_DhS_(<2 x half> %x, <2 x half> %y)
420  ret <2 x half> %pow
421}
422
423define <3 x half> @test_pow_v3f16(<3 x half> %x, <3 x half> %y) {
424; CHECK-LABEL: define <3 x half> @test_pow_v3f16
425; CHECK-SAME: (<3 x half> [[X:%.*]], <3 x half> [[Y:%.*]]) {
426; CHECK-NEXT:    [[POW:%.*]] = tail call <3 x half> @_Z3powDv3_DhS_(<3 x half> [[X]], <3 x half> [[Y]])
427; CHECK-NEXT:    ret <3 x half> [[POW]]
428;
429  %pow = tail call <3 x half> @_Z3powDv3_DhS_(<3 x half> %x, <3 x half> %y)
430  ret <3 x half> %pow
431}
432
433define <4 x half> @test_pow_v4f16(<4 x half> %x, <4 x half> %y) {
434; CHECK-LABEL: define <4 x half> @test_pow_v4f16
435; CHECK-SAME: (<4 x half> [[X:%.*]], <4 x half> [[Y:%.*]]) {
436; CHECK-NEXT:    [[POW:%.*]] = tail call <4 x half> @_Z3powDv4_DhS_(<4 x half> [[X]], <4 x half> [[Y]])
437; CHECK-NEXT:    ret <4 x half> [[POW]]
438;
439  %pow = tail call <4 x half> @_Z3powDv4_DhS_(<4 x half> %x, <4 x half> %y)
440  ret <4 x half> %pow
441}
442
443define <8 x half> @test_pow_v8f16(<8 x half> %x, <8 x half> %y) {
444; CHECK-LABEL: define <8 x half> @test_pow_v8f16
445; CHECK-SAME: (<8 x half> [[X:%.*]], <8 x half> [[Y:%.*]]) {
446; CHECK-NEXT:    [[POW:%.*]] = tail call <8 x half> @_Z3powDv8_DhS_(<8 x half> [[X]], <8 x half> [[Y]])
447; CHECK-NEXT:    ret <8 x half> [[POW]]
448;
449  %pow = tail call <8 x half> @_Z3powDv8_DhS_(<8 x half> %x, <8 x half> %y)
450  ret <8 x half> %pow
451}
452
453define <16 x half> @test_pow_v16f16(<16 x half> %x, <16 x half> %y) {
454; CHECK-LABEL: define <16 x half> @test_pow_v16f16
455; CHECK-SAME: (<16 x half> [[X:%.*]], <16 x half> [[Y:%.*]]) {
456; CHECK-NEXT:    [[POW:%.*]] = tail call <16 x half> @_Z3powDv16_DhS_(<16 x half> [[X]], <16 x half> [[Y]])
457; CHECK-NEXT:    ret <16 x half> [[POW]]
458;
459  %pow = tail call <16 x half> @_Z3powDv16_DhS_(<16 x half> %x, <16 x half> %y)
460  ret <16 x half> %pow
461}
462
463define float @test_pow_afn_f32_minsize(float %x, float %y) #0 {
464; CHECK-LABEL: define float @test_pow_afn_f32_minsize
465; CHECK-SAME: (float [[X:%.*]], float [[Y:%.*]]) #[[ATTR2:[0-9]+]] {
466; CHECK-NEXT:    [[POW:%.*]] = tail call afn float @_Z3powff(float [[X]], float [[Y]])
467; CHECK-NEXT:    ret float [[POW]]
468;
469  %pow = tail call afn float @_Z3powff(float %x, float %y)
470  ret float %pow
471}
472
473define float @test_pow_afn_f32_nnan_minsize(float %x, float %y) #0 {
474; CHECK-LABEL: define float @test_pow_afn_f32_nnan_minsize
475; CHECK-SAME: (float [[X:%.*]], float [[Y:%.*]]) #[[ATTR2]] {
476; CHECK-NEXT:    [[POW:%.*]] = tail call nnan afn float @_Z3powff(float [[X]], float [[Y]])
477; CHECK-NEXT:    ret float [[POW]]
478;
479  %pow = tail call afn nnan float @_Z3powff(float %x, float %y)
480  ret float %pow
481}
482
483define float @test_pow_afn_f32_noinline(float %x, float %y) {
484; CHECK-LABEL: define float @test_pow_afn_f32_noinline
485; CHECK-SAME: (float [[X:%.*]], float [[Y:%.*]]) {
486; CHECK-NEXT:    [[POW:%.*]] = tail call afn float @_Z3powff(float [[X]], float [[Y]]) #[[ATTR5:[0-9]+]]
487; CHECK-NEXT:    ret float [[POW]]
488;
489  %pow = tail call afn float @_Z3powff(float %x, float %y) #1
490  ret float %pow
491}
492
493define float @test_pow_afn_f32_nnan_noinline(float %x, float %y) {
494; CHECK-LABEL: define float @test_pow_afn_f32_nnan_noinline
495; CHECK-SAME: (float [[X:%.*]], float [[Y:%.*]]) {
496; CHECK-NEXT:    [[POW:%.*]] = tail call nnan afn float @_Z3powff(float [[X]], float [[Y]]) #[[ATTR5]]
497; CHECK-NEXT:    ret float [[POW]]
498;
499  %pow = tail call afn nnan float @_Z3powff(float %x, float %y) #1
500  ret float %pow
501}
502
503define float @test_pow_afn_f32_strictfp(float %x, float %y) #2 {
504; CHECK-LABEL: define float @test_pow_afn_f32_strictfp
505; CHECK-SAME: (float [[X:%.*]], float [[Y:%.*]]) #[[ATTR3:[0-9]+]] {
506; CHECK-NEXT:    [[POW:%.*]] = tail call nnan nsz afn float @_Z3powff(float [[X]], float [[Y]]) #[[ATTR3]]
507; CHECK-NEXT:    ret float [[POW]]
508;
509  %pow = tail call afn nsz nnan float @_Z3powff(float %x, float %y) #2
510  ret float %pow
511}
512
513define float @test_pow_fast_f32_nobuiltin(float %x, float %y) {
514; CHECK-LABEL: define float @test_pow_fast_f32_nobuiltin
515; CHECK-SAME: (float [[X:%.*]], float [[Y:%.*]]) {
516; CHECK-NEXT:    [[POW:%.*]] = tail call fast float @_Z3powff(float [[X]], float [[Y]]) #[[ATTR6:[0-9]+]]
517; CHECK-NEXT:    ret float [[POW]]
518;
519  %pow = tail call fast float @_Z3powff(float %x, float %y) #3
520  ret float %pow
521}
522
523define float @test_pow_afn_f32_0.0(float %x) {
524; CHECK-LABEL: define float @test_pow_afn_f32_0.0
525; CHECK-SAME: (float [[X:%.*]]) {
526; CHECK-NEXT:    ret float 1.000000e+00
527;
528  %pow = tail call afn float @_Z3powff(float %x, float 0.0)
529  ret float %pow
530}
531
532define float @test_pow_afn_f32_neg0.0(float %x) {
533; CHECK-LABEL: define float @test_pow_afn_f32_neg0.0
534; CHECK-SAME: (float [[X:%.*]]) {
535; CHECK-NEXT:    ret float 1.000000e+00
536;
537  %pow = tail call afn float @_Z3powff(float %x, float -0.0)
538  ret float %pow
539}
540
541define <2 x float> @test_pow_afn_v2f32_0.0(<2 x float> %x) {
542; CHECK-LABEL: define <2 x float> @test_pow_afn_v2f32_0.0
543; CHECK-SAME: (<2 x float> [[X:%.*]]) {
544; CHECK-NEXT:    ret <2 x float> splat (float 1.000000e+00)
545;
546  %pow = tail call afn <2 x float> @_Z3powDv2_fS_(<2 x float> %x, <2 x float> <float 0.0, float 0.0>)
547  ret <2 x float> %pow
548}
549
550define <2 x float> @test_pow_afn_v2f32_neg0.0(<2 x float> %x) {
551; CHECK-LABEL: define <2 x float> @test_pow_afn_v2f32_neg0.0
552; CHECK-SAME: (<2 x float> [[X:%.*]]) {
553; CHECK-NEXT:    ret <2 x float> splat (float 1.000000e+00)
554;
555  %pow = tail call afn <2 x float> @_Z3powDv2_fS_(<2 x float> %x, <2 x float> <float -0.0, float -0.0>)
556  ret <2 x float> %pow
557}
558
559define <2 x float> @test_pow_afn_v2f32_plus_minus_0.0(<2 x float> %x) {
560; CHECK-LABEL: define <2 x float> @test_pow_afn_v2f32_plus_minus_0.0
561; CHECK-SAME: (<2 x float> [[X:%.*]]) {
562; CHECK-NEXT:    ret <2 x float> splat (float 1.000000e+00)
563;
564  %pow = tail call afn <2 x float> @_Z3powDv2_fS_(<2 x float> %x, <2 x float> <float 0.0, float -0.0>)
565  ret <2 x float> %pow
566}
567
568define <3 x float> @test_pow_afn_v3f32_0.0_splat_undef(<3 x float> %x, <3 x float> %y) {
569; CHECK-LABEL: define <3 x float> @test_pow_afn_v3f32_0.0_splat_undef
570; CHECK-SAME: (<3 x float> [[X:%.*]], <3 x float> [[Y:%.*]]) {
571; CHECK-NEXT:    ret <3 x float> splat (float 1.000000e+00)
572;
573  %pow = tail call afn <3 x float> @_Z3powDv3_fS_(<3 x float> %x, <3 x float> <float 0.0, float poison, float 0.0>)
574  ret <3 x float> %pow
575}
576
577define <3 x float> @test_pow_afn_v3f32_neg0.0_splat_undef(<3 x float> %x, <3 x float> %y) {
578; CHECK-LABEL: define <3 x float> @test_pow_afn_v3f32_neg0.0_splat_undef
579; CHECK-SAME: (<3 x float> [[X:%.*]], <3 x float> [[Y:%.*]]) {
580; CHECK-NEXT:    ret <3 x float> splat (float 1.000000e+00)
581;
582  %pow = tail call afn <3 x float> @_Z3powDv3_fS_(<3 x float> %x, <3 x float> <float -0.0, float poison, float -0.0>)
583  ret <3 x float> %pow
584}
585
586define float @test_pow_afn_f32_0.5(float %x) {
587; CHECK-LABEL: define float @test_pow_afn_f32_0.5
588; CHECK-SAME: (float [[X:%.*]]) {
589; CHECK-NEXT:    [[__POW2SQRT:%.*]] = call afn float @_Z4sqrtf(float [[X]])
590; CHECK-NEXT:    ret float [[__POW2SQRT]]
591;
592  %pow = tail call afn float @_Z3powff(float %x, float 0.5)
593  ret float %pow
594}
595
596define float @test_pow_afn_f32_neg0.5(float %x) {
597; CHECK-LABEL: define float @test_pow_afn_f32_neg0.5
598; CHECK-SAME: (float [[X:%.*]]) {
599; CHECK-NEXT:    [[__POW2RSQRT:%.*]] = call afn float @_Z5rsqrtf(float [[X]])
600; CHECK-NEXT:    ret float [[__POW2RSQRT]]
601;
602  %pow = tail call afn float @_Z3powff(float %x, float -0.5)
603  ret float %pow
604}
605
606define <2 x float> @test_pow_afn_v2f32_0.5(<2 x float> %x) {
607; CHECK-LABEL: define <2 x float> @test_pow_afn_v2f32_0.5
608; CHECK-SAME: (<2 x float> [[X:%.*]]) {
609; CHECK-NEXT:    [[__POW2SQRT:%.*]] = call afn <2 x float> @_Z4sqrtDv2_f(<2 x float> [[X]])
610; CHECK-NEXT:    ret <2 x float> [[__POW2SQRT]]
611;
612  %pow = tail call afn <2 x float> @_Z3powDv2_fS_(<2 x float> %x, <2 x float> <float 0.5, float 0.5>)
613  ret <2 x float> %pow
614}
615
616define <2 x float> @test_pow_afn_v2f32_neg0.5(<2 x float> %x) {
617; CHECK-LABEL: define <2 x float> @test_pow_afn_v2f32_neg0.5
618; CHECK-SAME: (<2 x float> [[X:%.*]]) {
619; CHECK-NEXT:    [[__POW2RSQRT:%.*]] = call afn <2 x float> @_Z5rsqrtDv2_f(<2 x float> [[X]])
620; CHECK-NEXT:    ret <2 x float> [[__POW2RSQRT]]
621;
622  %pow = tail call afn <2 x float> @_Z3powDv2_fS_(<2 x float> %x, <2 x float> <float -0.5, float -0.5>)
623  ret <2 x float> %pow
624}
625
626define <2 x float> @test_pow_afn_v2f32_plus_minus_0.5(<2 x float> %x) {
627; CHECK-LABEL: define <2 x float> @test_pow_afn_v2f32_plus_minus_0.5
628; CHECK-SAME: (<2 x float> [[X:%.*]]) {
629; CHECK-NEXT:    [[POW:%.*]] = tail call afn <2 x float> @_Z3powDv2_fS_(<2 x float> [[X]], <2 x float> <float 5.000000e-01, float -5.000000e-01>)
630; CHECK-NEXT:    ret <2 x float> [[POW]]
631;
632  %pow = tail call afn <2 x float> @_Z3powDv2_fS_(<2 x float> %x, <2 x float> <float 0.5, float -0.5>)
633  ret <2 x float> %pow
634}
635
636define <3 x float> @test_pow_afn_v3f32_0.5_splat_undef(<3 x float> %x, <3 x float> %y) {
637; CHECK-LABEL: define <3 x float> @test_pow_afn_v3f32_0.5_splat_undef
638; CHECK-SAME: (<3 x float> [[X:%.*]], <3 x float> [[Y:%.*]]) {
639; CHECK-NEXT:    [[__POW2SQRT:%.*]] = call afn <3 x float> @_Z4sqrtDv3_f(<3 x float> [[X]])
640; CHECK-NEXT:    ret <3 x float> [[__POW2SQRT]]
641;
642  %pow = tail call afn <3 x float> @_Z3powDv3_fS_(<3 x float> %x, <3 x float> <float 0.5, float poison, float 0.5>)
643  ret <3 x float> %pow
644}
645
646define <3 x float> @test_pow_afn_v3f32_neg0.5_splat_undef(<3 x float> %x, <3 x float> %y) {
647; CHECK-LABEL: define <3 x float> @test_pow_afn_v3f32_neg0.5_splat_undef
648; CHECK-SAME: (<3 x float> [[X:%.*]], <3 x float> [[Y:%.*]]) {
649; CHECK-NEXT:    [[__POW2RSQRT:%.*]] = call afn <3 x float> @_Z5rsqrtDv3_f(<3 x float> [[X]])
650; CHECK-NEXT:    ret <3 x float> [[__POW2RSQRT]]
651;
652  %pow = tail call afn <3 x float> @_Z3powDv3_fS_(<3 x float> %x, <3 x float> <float -0.5, float poison, float -0.5>)
653  ret <3 x float> %pow
654}
655
656define float @test_pow_afn_f32_1.0(float %x) {
657; CHECK-LABEL: define float @test_pow_afn_f32_1.0
658; CHECK-SAME: (float [[X:%.*]]) {
659; CHECK-NEXT:    ret float [[X]]
660;
661  %pow = tail call afn float @_Z3powff(float %x, float 1.0)
662  ret float %pow
663}
664
665define float @test_pow_afn_f32_neg1.0(float %x) {
666; CHECK-LABEL: define float @test_pow_afn_f32_neg1.0
667; CHECK-SAME: (float [[X:%.*]]) {
668; CHECK-NEXT:    [[__POWRECIP:%.*]] = fdiv afn float 1.000000e+00, [[X]]
669; CHECK-NEXT:    ret float [[__POWRECIP]]
670;
671  %pow = tail call afn float @_Z3powff(float %x, float -1.0)
672  ret float %pow
673}
674
675define <2 x float> @test_pow_afn_v2f32_1.0(<2 x float> %x) {
676; CHECK-LABEL: define <2 x float> @test_pow_afn_v2f32_1.0
677; CHECK-SAME: (<2 x float> [[X:%.*]]) {
678; CHECK-NEXT:    ret <2 x float> [[X]]
679;
680  %pow = tail call afn <2 x float> @_Z3powDv2_fS_(<2 x float> %x, <2 x float> <float 1.0, float 1.0>)
681  ret <2 x float> %pow
682}
683
684define <2 x float> @test_pow_afn_v2f32_neg1.0(<2 x float> %x) {
685; CHECK-LABEL: define <2 x float> @test_pow_afn_v2f32_neg1.0
686; CHECK-SAME: (<2 x float> [[X:%.*]]) {
687; CHECK-NEXT:    [[__POWRECIP:%.*]] = fdiv afn <2 x float> splat (float 1.000000e+00), [[X]]
688; CHECK-NEXT:    ret <2 x float> [[__POWRECIP]]
689;
690  %pow = tail call afn <2 x float> @_Z3powDv2_fS_(<2 x float> %x, <2 x float> <float -1.0, float -1.0>)
691  ret <2 x float> %pow
692}
693
694define <2 x float> @test_pow_afn_v2f32_plus_minus_1.0(<2 x float> %x) {
695; CHECK-LABEL: define <2 x float> @test_pow_afn_v2f32_plus_minus_1.0
696; CHECK-SAME: (<2 x float> [[X:%.*]]) {
697; CHECK-NEXT:    [[POW:%.*]] = tail call afn <2 x float> @_Z4pownDv2_fDv2_i(<2 x float> [[X]], <2 x i32> <i32 1, i32 -1>)
698; CHECK-NEXT:    ret <2 x float> [[POW]]
699;
700  %pow = tail call afn <2 x float> @_Z3powDv2_fS_(<2 x float> %x, <2 x float> <float 1.0, float -1.0>)
701  ret <2 x float> %pow
702}
703
704define <3 x float> @test_pow_afn_v3f32_1.0_splat_undef(<3 x float> %x, <3 x float> %y) {
705; CHECK-LABEL: define <3 x float> @test_pow_afn_v3f32_1.0_splat_undef
706; CHECK-SAME: (<3 x float> [[X:%.*]], <3 x float> [[Y:%.*]]) {
707; CHECK-NEXT:    ret <3 x float> [[X]]
708;
709  %pow = tail call afn <3 x float> @_Z3powDv3_fS_(<3 x float> %x, <3 x float> <float 1.0, float poison, float 1.0>)
710  ret <3 x float> %pow
711}
712
713define <3 x float> @test_pow_afn_v3f32_neg1.0_splat_undef(<3 x float> %x, <3 x float> %y) {
714; CHECK-LABEL: define <3 x float> @test_pow_afn_v3f32_neg1.0_splat_undef
715; CHECK-SAME: (<3 x float> [[X:%.*]], <3 x float> [[Y:%.*]]) {
716; CHECK-NEXT:    [[__POWRECIP:%.*]] = fdiv afn <3 x float> splat (float 1.000000e+00), [[X]]
717; CHECK-NEXT:    ret <3 x float> [[__POWRECIP]]
718;
719  %pow = tail call afn <3 x float> @_Z3powDv3_fS_(<3 x float> %x, <3 x float> <float -1.0, float poison, float -1.0>)
720  ret <3 x float> %pow
721}
722
723define float @test_pow_afn_f32_2.0(float %x) {
724; CHECK-LABEL: define float @test_pow_afn_f32_2.0
725; CHECK-SAME: (float [[X:%.*]]) {
726; CHECK-NEXT:    [[__POW2:%.*]] = fmul afn float [[X]], [[X]]
727; CHECK-NEXT:    ret float [[__POW2]]
728;
729  %pow = tail call afn float @_Z3powff(float %x, float 2.0)
730  ret float %pow
731}
732
733define float @test_pow_afn_f32_neg2.0(float %x) {
734; CHECK-LABEL: define float @test_pow_afn_f32_neg2.0
735; CHECK-SAME: (float [[X:%.*]]) {
736; CHECK-NEXT:    [[POW:%.*]] = tail call afn float @_Z4pownfi(float [[X]], i32 -2)
737; CHECK-NEXT:    ret float [[POW]]
738;
739  %pow = tail call afn float @_Z3powff(float %x, float -2.0)
740  ret float %pow
741}
742
743define <2 x float> @test_pow_afn_v2f32_2.0(<2 x float> %x) {
744; CHECK-LABEL: define <2 x float> @test_pow_afn_v2f32_2.0
745; CHECK-SAME: (<2 x float> [[X:%.*]]) {
746; CHECK-NEXT:    [[__POW2:%.*]] = fmul afn <2 x float> [[X]], [[X]]
747; CHECK-NEXT:    ret <2 x float> [[__POW2]]
748;
749  %pow = tail call afn <2 x float> @_Z3powDv2_fS_(<2 x float> %x, <2 x float> <float 2.0, float 2.0>)
750  ret <2 x float> %pow
751}
752
753define <2 x float> @test_pow_afn_v2f32_neg2.0(<2 x float> %x) {
754; CHECK-LABEL: define <2 x float> @test_pow_afn_v2f32_neg2.0
755; CHECK-SAME: (<2 x float> [[X:%.*]]) {
756; CHECK-NEXT:    [[POW:%.*]] = tail call afn <2 x float> @_Z4pownDv2_fDv2_i(<2 x float> [[X]], <2 x i32> splat (i32 -2))
757; CHECK-NEXT:    ret <2 x float> [[POW]]
758;
759  %pow = tail call afn <2 x float> @_Z3powDv2_fS_(<2 x float> %x, <2 x float> <float -2.0, float -2.0>)
760  ret <2 x float> %pow
761}
762
763define <2 x float> @test_pow_afn_v2f32_plus_minus_2.0(<2 x float> %x) {
764; CHECK-LABEL: define <2 x float> @test_pow_afn_v2f32_plus_minus_2.0
765; CHECK-SAME: (<2 x float> [[X:%.*]]) {
766; CHECK-NEXT:    [[POW:%.*]] = tail call afn <2 x float> @_Z4pownDv2_fDv2_i(<2 x float> [[X]], <2 x i32> <i32 2, i32 -2>)
767; CHECK-NEXT:    ret <2 x float> [[POW]]
768;
769  %pow = tail call afn <2 x float> @_Z3powDv2_fS_(<2 x float> %x, <2 x float> <float 2.0, float -2.0>)
770  ret <2 x float> %pow
771}
772
773define float @test_pow_afn_f32_3.0(float %x) {
774; CHECK-LABEL: define float @test_pow_afn_f32_3.0
775; CHECK-SAME: (float [[X:%.*]]) {
776; CHECK-NEXT:    [[POW:%.*]] = tail call afn float @_Z4pownfi(float [[X]], i32 3)
777; CHECK-NEXT:    ret float [[POW]]
778;
779  %pow = tail call afn float @_Z3powff(float %x, float 3.0)
780  ret float %pow
781}
782
783define float @test_pow_afn_f32_neg3.0(float %x) {
784; CHECK-LABEL: define float @test_pow_afn_f32_neg3.0
785; CHECK-SAME: (float [[X:%.*]]) {
786; CHECK-NEXT:    [[POW:%.*]] = tail call afn float @_Z4pownfi(float [[X]], i32 -3)
787; CHECK-NEXT:    ret float [[POW]]
788;
789  %pow = tail call afn float @_Z3powff(float %x, float -3.0)
790  ret float %pow
791}
792
793define <2 x float> @test_pow_afn_v2f32_3.0(<2 x float> %x) {
794; CHECK-LABEL: define <2 x float> @test_pow_afn_v2f32_3.0
795; CHECK-SAME: (<2 x float> [[X:%.*]]) {
796; CHECK-NEXT:    [[POW:%.*]] = tail call afn <2 x float> @_Z4pownDv2_fDv2_i(<2 x float> [[X]], <2 x i32> splat (i32 3))
797; CHECK-NEXT:    ret <2 x float> [[POW]]
798;
799  %pow = tail call afn <2 x float> @_Z3powDv2_fS_(<2 x float> %x, <2 x float> <float 3.0, float 3.0>)
800  ret <2 x float> %pow
801}
802
803define <2 x float> @test_pow_afn_v2f32_neg3.0(<2 x float> %x) {
804; CHECK-LABEL: define <2 x float> @test_pow_afn_v2f32_neg3.0
805; CHECK-SAME: (<2 x float> [[X:%.*]]) {
806; CHECK-NEXT:    [[POW:%.*]] = tail call afn <2 x float> @_Z4pownDv2_fDv2_i(<2 x float> [[X]], <2 x i32> splat (i32 -3))
807; CHECK-NEXT:    ret <2 x float> [[POW]]
808;
809  %pow = tail call afn <2 x float> @_Z3powDv2_fS_(<2 x float> %x, <2 x float> <float -3.0, float -3.0>)
810  ret <2 x float> %pow
811}
812
813define <2 x float> @test_pow_afn_v2f32_plus_minus_3.0(<2 x float> %x) {
814; CHECK-LABEL: define <2 x float> @test_pow_afn_v2f32_plus_minus_3.0
815; CHECK-SAME: (<2 x float> [[X:%.*]]) {
816; CHECK-NEXT:    [[POW:%.*]] = tail call afn <2 x float> @_Z4pownDv2_fDv2_i(<2 x float> [[X]], <2 x i32> <i32 3, i32 -3>)
817; CHECK-NEXT:    ret <2 x float> [[POW]]
818;
819  %pow = tail call afn <2 x float> @_Z3powDv2_fS_(<2 x float> %x, <2 x float> <float 3.0, float -3.0>)
820  ret <2 x float> %pow
821}
822
823define float @test_pow_afn_f32_3.99(float %x) {
824; CHECK-LABEL: define float @test_pow_afn_f32_3.99
825; CHECK-SAME: (float [[X:%.*]]) {
826; CHECK-NEXT:    [[POW:%.*]] = tail call afn float @_Z3powff(float [[X]], float 0x400FEB8520000000)
827; CHECK-NEXT:    ret float [[POW]]
828;
829  %pow = tail call afn float @_Z3powff(float %x, float 0x400FEB8520000000)
830  ret float %pow
831}
832
833define float @test_pow_afn_f32_neg3.99(float %x) {
834; CHECK-LABEL: define float @test_pow_afn_f32_neg3.99
835; CHECK-SAME: (float [[X:%.*]]) {
836; CHECK-NEXT:    [[POW:%.*]] = tail call afn float @_Z3powff(float [[X]], float 0xC00FEB8520000000)
837; CHECK-NEXT:    ret float [[POW]]
838;
839  %pow = tail call afn float @_Z3powff(float %x, float 0xC00FEB8520000000)
840  ret float %pow
841}
842
843define <2 x float> @test_pow_afn_v2f32_3.99(<2 x float> %x) {
844; CHECK-LABEL: define <2 x float> @test_pow_afn_v2f32_3.99
845; CHECK-SAME: (<2 x float> [[X:%.*]]) {
846; CHECK-NEXT:    [[POW:%.*]] = tail call afn <2 x float> @_Z3powDv2_fS_(<2 x float> [[X]], <2 x float> splat (float 0x400FEB8520000000))
847; CHECK-NEXT:    ret <2 x float> [[POW]]
848;
849  %pow = tail call afn <2 x float> @_Z3powDv2_fS_(<2 x float> %x, <2 x float> <float 0x400FEB8520000000, float 0x400FEB8520000000>)
850  ret <2 x float> %pow
851}
852
853define <2 x float> @test_pow_afn_v2f32_neg3.99(<2 x float> %x) {
854; CHECK-LABEL: define <2 x float> @test_pow_afn_v2f32_neg3.99
855; CHECK-SAME: (<2 x float> [[X:%.*]]) {
856; CHECK-NEXT:    [[POW:%.*]] = tail call afn <2 x float> @_Z3powDv2_fS_(<2 x float> [[X]], <2 x float> splat (float 0xC00FEB8520000000))
857; CHECK-NEXT:    ret <2 x float> [[POW]]
858;
859  %pow = tail call afn <2 x float> @_Z3powDv2_fS_(<2 x float> %x, <2 x float> <float 0xC00FEB8520000000, float 0xC00FEB8520000000>)
860  ret <2 x float> %pow
861}
862
863define <2 x float> @test_pow_afn_v2f32_plus_minus_3.99(<2 x float> %x) {
864; CHECK-LABEL: define <2 x float> @test_pow_afn_v2f32_plus_minus_3.99
865; CHECK-SAME: (<2 x float> [[X:%.*]]) {
866; CHECK-NEXT:    [[POW:%.*]] = tail call afn <2 x float> @_Z3powDv2_fS_(<2 x float> [[X]], <2 x float> <float 0x400FEB8520000000, float 0xC00FEB8520000000>)
867; CHECK-NEXT:    ret <2 x float> [[POW]]
868;
869  %pow = tail call afn <2 x float> @_Z3powDv2_fS_(<2 x float> %x, <2 x float> <float 0x400FEB8520000000, float 0xC00FEB8520000000>)
870  ret <2 x float> %pow
871}
872
873define float @test_pow_afn_f32_8.0(float %x) {
874; CHECK-LABEL: define float @test_pow_afn_f32_8.0
875; CHECK-SAME: (float [[X:%.*]]) {
876; CHECK-NEXT:    [[POW:%.*]] = tail call afn float @_Z4pownfi(float [[X]], i32 8)
877; CHECK-NEXT:    ret float [[POW]]
878;
879  %pow = tail call afn float @_Z3powff(float %x, float 8.0)
880  ret float %pow
881}
882
883define float @test_pow_afn_f32_neg8.0(float %x) {
884; CHECK-LABEL: define float @test_pow_afn_f32_neg8.0
885; CHECK-SAME: (float [[X:%.*]]) {
886; CHECK-NEXT:    [[POW:%.*]] = tail call afn float @_Z4pownfi(float [[X]], i32 -8)
887; CHECK-NEXT:    ret float [[POW]]
888;
889  %pow = tail call afn float @_Z3powff(float %x, float -8.0)
890  ret float %pow
891}
892
893define <2 x float> @test_pow_afn_v2f32_8.0(<2 x float> %x) {
894; CHECK-LABEL: define <2 x float> @test_pow_afn_v2f32_8.0
895; CHECK-SAME: (<2 x float> [[X:%.*]]) {
896; CHECK-NEXT:    [[POW:%.*]] = tail call afn <2 x float> @_Z4pownDv2_fDv2_i(<2 x float> [[X]], <2 x i32> splat (i32 8))
897; CHECK-NEXT:    ret <2 x float> [[POW]]
898;
899  %pow = tail call afn <2 x float> @_Z3powDv2_fS_(<2 x float> %x, <2 x float> <float 8.0, float 8.0>)
900  ret <2 x float> %pow
901}
902
903define <2 x float> @test_pow_afn_v2f32_neg8.0(<2 x float> %x) {
904; CHECK-LABEL: define <2 x float> @test_pow_afn_v2f32_neg8.0
905; CHECK-SAME: (<2 x float> [[X:%.*]]) {
906; CHECK-NEXT:    [[POW:%.*]] = tail call afn <2 x float> @_Z4pownDv2_fDv2_i(<2 x float> [[X]], <2 x i32> splat (i32 -8))
907; CHECK-NEXT:    ret <2 x float> [[POW]]
908;
909  %pow = tail call afn <2 x float> @_Z3powDv2_fS_(<2 x float> %x, <2 x float> <float -8.0, float -8.0>)
910  ret <2 x float> %pow
911}
912
913define <2 x float> @test_pow_afn_v2f32_plus_minus_8.0(<2 x float> %x) {
914; CHECK-LABEL: define <2 x float> @test_pow_afn_v2f32_plus_minus_8.0
915; CHECK-SAME: (<2 x float> [[X:%.*]]) {
916; CHECK-NEXT:    [[POW:%.*]] = tail call afn <2 x float> @_Z4pownDv2_fDv2_i(<2 x float> [[X]], <2 x i32> <i32 8, i32 -8>)
917; CHECK-NEXT:    ret <2 x float> [[POW]]
918;
919  %pow = tail call afn <2 x float> @_Z3powDv2_fS_(<2 x float> %x, <2 x float> <float 8.0, float -8.0>)
920  ret <2 x float> %pow
921}
922
923define float @test_pow_afn_f32_12.0(float %x) {
924; CHECK-LABEL: define float @test_pow_afn_f32_12.0
925; CHECK-SAME: (float [[X:%.*]]) {
926; CHECK-NEXT:    [[POW:%.*]] = tail call afn float @_Z4pownfi(float [[X]], i32 12)
927; CHECK-NEXT:    ret float [[POW]]
928;
929  %pow = tail call afn float @_Z3powff(float %x, float 12.0)
930  ret float %pow
931}
932
933define float @test_pow_afn_f32_neg12.0(float %x) {
934; CHECK-LABEL: define float @test_pow_afn_f32_neg12.0
935; CHECK-SAME: (float [[X:%.*]]) {
936; CHECK-NEXT:    [[POW:%.*]] = tail call afn float @_Z4pownfi(float [[X]], i32 -12)
937; CHECK-NEXT:    ret float [[POW]]
938;
939  %pow = tail call afn float @_Z3powff(float %x, float -12.0)
940  ret float %pow
941}
942
943define <2 x float> @test_pow_afn_v2f32_12.0(<2 x float> %x) {
944; CHECK-LABEL: define <2 x float> @test_pow_afn_v2f32_12.0
945; CHECK-SAME: (<2 x float> [[X:%.*]]) {
946; CHECK-NEXT:    [[POW:%.*]] = tail call afn <2 x float> @_Z4pownDv2_fDv2_i(<2 x float> [[X]], <2 x i32> splat (i32 12))
947; CHECK-NEXT:    ret <2 x float> [[POW]]
948;
949  %pow = tail call afn <2 x float> @_Z3powDv2_fS_(<2 x float> %x, <2 x float> <float 12.0, float 12.0>)
950  ret <2 x float> %pow
951}
952
953define <2 x float> @test_pow_afn_v2f32_neg12.0(<2 x float> %x) {
954; CHECK-LABEL: define <2 x float> @test_pow_afn_v2f32_neg12.0
955; CHECK-SAME: (<2 x float> [[X:%.*]]) {
956; CHECK-NEXT:    [[POW:%.*]] = tail call afn <2 x float> @_Z4pownDv2_fDv2_i(<2 x float> [[X]], <2 x i32> splat (i32 -12))
957; CHECK-NEXT:    ret <2 x float> [[POW]]
958;
959  %pow = tail call afn <2 x float> @_Z3powDv2_fS_(<2 x float> %x, <2 x float> <float -12.0, float -12.0>)
960  ret <2 x float> %pow
961}
962
963define <2 x float> @test_pow_afn_v2f32_plus_minus_12.0(<2 x float> %x) {
964; CHECK-LABEL: define <2 x float> @test_pow_afn_v2f32_plus_minus_12.0
965; CHECK-SAME: (<2 x float> [[X:%.*]]) {
966; CHECK-NEXT:    [[POW:%.*]] = tail call afn <2 x float> @_Z4pownDv2_fDv2_i(<2 x float> [[X]], <2 x i32> <i32 12, i32 -12>)
967; CHECK-NEXT:    ret <2 x float> [[POW]]
968;
969  %pow = tail call afn <2 x float> @_Z3powDv2_fS_(<2 x float> %x, <2 x float> <float 12.0, float -12.0>)
970  ret <2 x float> %pow
971}
972
973define float @test_pow_afn_f32_13.0(float %x) {
974; CHECK-LABEL: define float @test_pow_afn_f32_13.0
975; CHECK-SAME: (float [[X:%.*]]) {
976; CHECK-NEXT:    [[POW:%.*]] = tail call afn float @_Z4pownfi(float [[X]], i32 13)
977; CHECK-NEXT:    ret float [[POW]]
978;
979  %pow = tail call afn float @_Z3powff(float %x, float 13.0)
980  ret float %pow
981}
982
983define float @test_pow_afn_f32_neg13.0(float %x) {
984; CHECK-LABEL: define float @test_pow_afn_f32_neg13.0
985; CHECK-SAME: (float [[X:%.*]]) {
986; CHECK-NEXT:    [[POW:%.*]] = tail call afn float @_Z4pownfi(float [[X]], i32 -13)
987; CHECK-NEXT:    ret float [[POW]]
988;
989  %pow = tail call afn float @_Z3powff(float %x, float -13.0)
990  ret float %pow
991}
992
993define <2 x float> @test_pow_afn_v2f32_13.0(<2 x float> %x) {
994; CHECK-LABEL: define <2 x float> @test_pow_afn_v2f32_13.0
995; CHECK-SAME: (<2 x float> [[X:%.*]]) {
996; CHECK-NEXT:    [[POW:%.*]] = tail call afn <2 x float> @_Z4pownDv2_fDv2_i(<2 x float> [[X]], <2 x i32> splat (i32 13))
997; CHECK-NEXT:    ret <2 x float> [[POW]]
998;
999  %pow = tail call afn <2 x float> @_Z3powDv2_fS_(<2 x float> %x, <2 x float> <float 13.0, float 13.0>)
1000  ret <2 x float> %pow
1001}
1002
1003define <2 x float> @test_pow_afn_v2f32_neg13.0(<2 x float> %x) {
1004; CHECK-LABEL: define <2 x float> @test_pow_afn_v2f32_neg13.0
1005; CHECK-SAME: (<2 x float> [[X:%.*]]) {
1006; CHECK-NEXT:    [[POW:%.*]] = tail call afn <2 x float> @_Z4pownDv2_fDv2_i(<2 x float> [[X]], <2 x i32> splat (i32 -13))
1007; CHECK-NEXT:    ret <2 x float> [[POW]]
1008;
1009  %pow = tail call afn <2 x float> @_Z3powDv2_fS_(<2 x float> %x, <2 x float> <float -13.0, float -13.0>)
1010  ret <2 x float> %pow
1011}
1012
1013define <2 x float> @test_pow_afn_v2f32_13.0_15.0(<2 x float> %x) {
1014; CHECK-LABEL: define <2 x float> @test_pow_afn_v2f32_13.0_15.0
1015; CHECK-SAME: (<2 x float> [[X:%.*]]) {
1016; CHECK-NEXT:    [[POW:%.*]] = tail call afn <2 x float> @_Z4pownDv2_fDv2_i(<2 x float> [[X]], <2 x i32> <i32 13, i32 15>)
1017; CHECK-NEXT:    ret <2 x float> [[POW]]
1018;
1019  %pow = tail call afn <2 x float> @_Z3powDv2_fS_(<2 x float> %x, <2 x float> <float 13.0, float 15.0>)
1020  ret <2 x float> %pow
1021}
1022
1023define <2 x float> @test_pow_afn_v2f32_13.0_14.0(<2 x float> %x) {
1024; CHECK-LABEL: define <2 x float> @test_pow_afn_v2f32_13.0_14.0
1025; CHECK-SAME: (<2 x float> [[X:%.*]]) {
1026; CHECK-NEXT:    [[POW:%.*]] = tail call afn <2 x float> @_Z4pownDv2_fDv2_i(<2 x float> [[X]], <2 x i32> <i32 13, i32 14>)
1027; CHECK-NEXT:    ret <2 x float> [[POW]]
1028;
1029  %pow = tail call afn <2 x float> @_Z3powDv2_fS_(<2 x float> %x, <2 x float> <float 13.0, float 14.0>)
1030  ret <2 x float> %pow
1031}
1032
1033define <2 x float> @test_pow_afn_v2f32_14.0_16.0(<2 x float> %x) {
1034; CHECK-LABEL: define <2 x float> @test_pow_afn_v2f32_14.0_16.0
1035; CHECK-SAME: (<2 x float> [[X:%.*]]) {
1036; CHECK-NEXT:    [[POW:%.*]] = tail call afn <2 x float> @_Z4pownDv2_fDv2_i(<2 x float> [[X]], <2 x i32> <i32 14, i32 16>)
1037; CHECK-NEXT:    ret <2 x float> [[POW]]
1038;
1039  %pow = tail call afn <2 x float> @_Z3powDv2_fS_(<2 x float> %x, <2 x float> <float 14.0, float 16.0>)
1040  ret <2 x float> %pow
1041}
1042
1043define <2 x float> @test_pow_afn_v2f32_plus_minus_13.0(<2 x float> %x) {
1044; CHECK-LABEL: define <2 x float> @test_pow_afn_v2f32_plus_minus_13.0
1045; CHECK-SAME: (<2 x float> [[X:%.*]]) {
1046; CHECK-NEXT:    [[POW:%.*]] = tail call afn <2 x float> @_Z4pownDv2_fDv2_i(<2 x float> [[X]], <2 x i32> <i32 13, i32 -13>)
1047; CHECK-NEXT:    ret <2 x float> [[POW]]
1048;
1049  %pow = tail call afn <2 x float> @_Z3powDv2_fS_(<2 x float> %x, <2 x float> <float 13.0, float -13.0>)
1050  ret <2 x float> %pow
1051}
1052
1053define <2 x float> @test_pow_afn_v2f32_plus_minus_13.0_minus_14.0(<2 x float> %x) {
1054; CHECK-LABEL: define <2 x float> @test_pow_afn_v2f32_plus_minus_13.0_minus_14.0
1055; CHECK-SAME: (<2 x float> [[X:%.*]]) {
1056; CHECK-NEXT:    [[POW:%.*]] = tail call afn <2 x float> @_Z4pownDv2_fDv2_i(<2 x float> [[X]], <2 x i32> <i32 -13, i32 -14>)
1057; CHECK-NEXT:    ret <2 x float> [[POW]]
1058;
1059  %pow = tail call afn <2 x float> @_Z3powDv2_fS_(<2 x float> %x, <2 x float> <float -13.0, float -14.0>)
1060  ret <2 x float> %pow
1061}
1062
1063define float @test_pow_afn_f32_nnan_x_known_positive(float nofpclass(ninf nnorm nsub) %x, float %y) {
1064; CHECK-LABEL: define float @test_pow_afn_f32_nnan_x_known_positive
1065; CHECK-SAME: (float nofpclass(ninf nsub nnorm) [[X:%.*]], float [[Y:%.*]]) {
1066; CHECK-NEXT:    [[POW:%.*]] = tail call nnan afn float @_Z4powrff(float [[X]], float [[Y]])
1067; CHECK-NEXT:    ret float [[POW]]
1068;
1069  %pow = tail call afn nnan float @_Z3powff(float %x, float %y)
1070  ret float %pow
1071}
1072
1073define float @test_pow_afn_f32_nnan_ninf_x_known_positive(float nofpclass(ninf nnorm nsub) %x, float %y) {
1074; CHECK-LABEL: define float @test_pow_afn_f32_nnan_ninf_x_known_positive
1075; CHECK-SAME: (float nofpclass(ninf nsub nnorm) [[X:%.*]], float [[Y:%.*]]) {
1076; CHECK-NEXT:    [[__LOG2:%.*]] = call nnan ninf afn float @llvm.log2.f32(float [[X]])
1077; CHECK-NEXT:    [[__YLOGX:%.*]] = fmul nnan ninf afn float [[Y]], [[__LOG2]]
1078; CHECK-NEXT:    [[__EXP2:%.*]] = call nnan ninf afn float @llvm.exp2.f32(float [[__YLOGX]])
1079; CHECK-NEXT:    ret float [[__EXP2]]
1080;
1081  %pow = tail call afn nnan ninf float @_Z3powff(float %x, float %y)
1082  ret float %pow
1083}
1084
1085define <2 x float> @test_pow_afn_v2f32_nnan_x_known_positive(<2 x float> nofpclass(ninf nnorm nsub) %x, <2 x float> %y) {
1086; CHECK-LABEL: define <2 x float> @test_pow_afn_v2f32_nnan_x_known_positive
1087; CHECK-SAME: (<2 x float> nofpclass(ninf nsub nnorm) [[X:%.*]], <2 x float> [[Y:%.*]]) {
1088; CHECK-NEXT:    [[POW:%.*]] = tail call nnan afn <2 x float> @_Z4powrDv2_fS_(<2 x float> [[X]], <2 x float> [[Y]])
1089; CHECK-NEXT:    ret <2 x float> [[POW]]
1090;
1091  %pow = tail call afn nnan <2 x float> @_Z3powDv2_fS_(<2 x float> %x, <2 x float> %y)
1092  ret <2 x float> %pow
1093}
1094
1095define <2 x float> @test_pow_afn_v2f32_nnan_ninf_x_known_positive(<2 x float> nofpclass(ninf nnorm nsub) %x, <2 x float> %y) {
1096; CHECK-LABEL: define <2 x float> @test_pow_afn_v2f32_nnan_ninf_x_known_positive
1097; CHECK-SAME: (<2 x float> nofpclass(ninf nsub nnorm) [[X:%.*]], <2 x float> [[Y:%.*]]) {
1098; CHECK-NEXT:    [[__LOG2:%.*]] = call nnan ninf afn <2 x float> @llvm.log2.v2f32(<2 x float> [[X]])
1099; CHECK-NEXT:    [[__YLOGX:%.*]] = fmul nnan ninf afn <2 x float> [[Y]], [[__LOG2]]
1100; CHECK-NEXT:    [[__EXP2:%.*]] = call nnan ninf afn <2 x float> @llvm.exp2.v2f32(<2 x float> [[__YLOGX]])
1101; CHECK-NEXT:    ret <2 x float> [[__EXP2]]
1102;
1103  %pow = tail call afn nnan ninf <2 x float> @_Z3powDv2_fS_(<2 x float> %x, <2 x float> %y)
1104  ret <2 x float> %pow
1105}
1106
1107define float @test_pow_f32_x_known_positive(float nofpclass(ninf nnorm nsub) %x, float %y) {
1108; CHECK-LABEL: define float @test_pow_f32_x_known_positive
1109; CHECK-SAME: (float nofpclass(ninf nsub nnorm) [[X:%.*]], float [[Y:%.*]]) {
1110; CHECK-NEXT:    [[POW:%.*]] = tail call float @_Z4powrff(float [[X]], float [[Y]])
1111; CHECK-NEXT:    ret float [[POW]]
1112;
1113  %pow = tail call float @_Z3powff(float %x, float %y)
1114  ret float %pow
1115}
1116
1117define float @test_pow_afn_f32_x_known_positive(float nofpclass(ninf nnorm nsub) %x, float %y) {
1118; CHECK-LABEL: define float @test_pow_afn_f32_x_known_positive
1119; CHECK-SAME: (float nofpclass(ninf nsub nnorm) [[X:%.*]], float [[Y:%.*]]) {
1120; CHECK-NEXT:    [[POW:%.*]] = tail call afn float @_Z4powrff(float [[X]], float [[Y]])
1121; CHECK-NEXT:    ret float [[POW]]
1122;
1123  %pow = tail call afn float @_Z3powff(float %x, float %y)
1124  ret float %pow
1125}
1126
1127define <2 x float> @test_pow_v2f32_x_known_positive(<2 x float> nofpclass(ninf nnorm nsub) %x, <2 x float> %y) {
1128; CHECK-LABEL: define <2 x float> @test_pow_v2f32_x_known_positive
1129; CHECK-SAME: (<2 x float> nofpclass(ninf nsub nnorm) [[X:%.*]], <2 x float> [[Y:%.*]]) {
1130; CHECK-NEXT:    [[POW:%.*]] = tail call <2 x float> @_Z4powrDv2_fS_(<2 x float> [[X]], <2 x float> [[Y]])
1131; CHECK-NEXT:    ret <2 x float> [[POW]]
1132;
1133  %pow = tail call <2 x float> @_Z3powDv2_fS_(<2 x float> %x, <2 x float> %y)
1134  ret <2 x float> %pow
1135}
1136
1137define <2 x float> @test_pow_afn_v2f32_x_known_positive(<2 x float> nofpclass(ninf nnorm nsub) %x, <2 x float> %y) {
1138; CHECK-LABEL: define <2 x float> @test_pow_afn_v2f32_x_known_positive
1139; CHECK-SAME: (<2 x float> nofpclass(ninf nsub nnorm) [[X:%.*]], <2 x float> [[Y:%.*]]) {
1140; CHECK-NEXT:    [[POW:%.*]] = tail call afn <2 x float> @_Z4powrDv2_fS_(<2 x float> [[X]], <2 x float> [[Y]])
1141; CHECK-NEXT:    ret <2 x float> [[POW]]
1142;
1143  %pow = tail call afn <2 x float> @_Z3powDv2_fS_(<2 x float> %x, <2 x float> %y)
1144  ret <2 x float> %pow
1145}
1146
1147define double @test_pow_afn_f64_nnan_x_known_positive(double nofpclass(ninf nnorm nsub) %x, double %y) {
1148; CHECK-LABEL: define double @test_pow_afn_f64_nnan_x_known_positive
1149; CHECK-SAME: (double nofpclass(ninf nsub nnorm) [[X:%.*]], double [[Y:%.*]]) {
1150; CHECK-NEXT:    [[POW:%.*]] = tail call nnan afn double @_Z4powrdd(double [[X]], double [[Y]])
1151; CHECK-NEXT:    ret double [[POW]]
1152;
1153  %pow = tail call afn nnan double @_Z3powdd(double %x, double %y)
1154  ret double %pow
1155}
1156
1157define double @test_pow_afn_f64_nnan_ninf_x_known_positive(double nofpclass(ninf nnorm nsub) %x, double %y) {
1158; CHECK-LABEL: define double @test_pow_afn_f64_nnan_ninf_x_known_positive
1159; CHECK-SAME: (double nofpclass(ninf nsub nnorm) [[X:%.*]], double [[Y:%.*]]) {
1160; CHECK-NEXT:    [[__LOG2:%.*]] = call nnan ninf afn double @_Z4log2d(double [[X]])
1161; CHECK-NEXT:    [[__YLOGX:%.*]] = fmul nnan ninf afn double [[Y]], [[__LOG2]]
1162; CHECK-NEXT:    [[__EXP2:%.*]] = call nnan ninf afn double @_Z4exp2d(double [[__YLOGX]])
1163; CHECK-NEXT:    ret double [[__EXP2]]
1164;
1165  %pow = tail call afn nnan ninf double @_Z3powdd(double %x, double %y)
1166  ret double %pow
1167}
1168
1169define <2 x double> @test_pow_afn_v2f64_nnan_x_known_positive(<2 x double> nofpclass(ninf nnorm nsub) %x, <2 x double> %y) {
1170; CHECK-LABEL: define <2 x double> @test_pow_afn_v2f64_nnan_x_known_positive
1171; CHECK-SAME: (<2 x double> nofpclass(ninf nsub nnorm) [[X:%.*]], <2 x double> [[Y:%.*]]) {
1172; CHECK-NEXT:    [[POW:%.*]] = tail call nnan afn <2 x double> @_Z4powrDv2_dS_(<2 x double> [[X]], <2 x double> [[Y]])
1173; CHECK-NEXT:    ret <2 x double> [[POW]]
1174;
1175  %pow = tail call afn nnan <2 x double> @_Z3powDv2_dS_(<2 x double> %x, <2 x double> %y)
1176  ret <2 x double> %pow
1177}
1178
1179define <2 x double> @test_pow_afn_v2f64_nnan_ninf_x_known_positive(<2 x double> nofpclass(ninf nnorm nsub) %x, <2 x double> %y) {
1180; CHECK-LABEL: define <2 x double> @test_pow_afn_v2f64_nnan_ninf_x_known_positive
1181; CHECK-SAME: (<2 x double> nofpclass(ninf nsub nnorm) [[X:%.*]], <2 x double> [[Y:%.*]]) {
1182; CHECK-NEXT:    [[__LOG2:%.*]] = call nnan ninf afn <2 x double> @_Z4log2Dv2_d(<2 x double> [[X]])
1183; CHECK-NEXT:    [[__YLOGX:%.*]] = fmul nnan ninf afn <2 x double> [[Y]], [[__LOG2]]
1184; CHECK-NEXT:    [[__EXP2:%.*]] = call nnan ninf afn <2 x double> @_Z4exp2Dv2_d(<2 x double> [[__YLOGX]])
1185; CHECK-NEXT:    ret <2 x double> [[__EXP2]]
1186;
1187  %pow = tail call afn nnan ninf <2 x double> @_Z3powDv2_dS_(<2 x double> %x, <2 x double> %y)
1188  ret <2 x double> %pow
1189}
1190
1191define double @test_pow_f64_x_known_positive(double nofpclass(ninf nnorm nsub) %x, double %y) {
1192; CHECK-LABEL: define double @test_pow_f64_x_known_positive
1193; CHECK-SAME: (double nofpclass(ninf nsub nnorm) [[X:%.*]], double [[Y:%.*]]) {
1194; CHECK-NEXT:    [[POW:%.*]] = tail call double @_Z4powrdd(double [[X]], double [[Y]])
1195; CHECK-NEXT:    ret double [[POW]]
1196;
1197  %pow = tail call double @_Z3powdd(double %x, double %y)
1198  ret double %pow
1199}
1200
1201define double @test_pow_afn_f64_x_known_positive(double nofpclass(ninf nnorm nsub) %x, double %y) {
1202; CHECK-LABEL: define double @test_pow_afn_f64_x_known_positive
1203; CHECK-SAME: (double nofpclass(ninf nsub nnorm) [[X:%.*]], double [[Y:%.*]]) {
1204; CHECK-NEXT:    [[POW:%.*]] = tail call afn double @_Z4powrdd(double [[X]], double [[Y]])
1205; CHECK-NEXT:    ret double [[POW]]
1206;
1207  %pow = tail call afn double @_Z3powdd(double %x, double %y)
1208  ret double %pow
1209}
1210
1211define <2 x double> @test_pow_v2f64_x_known_positive(<2 x double> nofpclass(ninf nnorm nsub) %x, <2 x double> %y) {
1212; CHECK-LABEL: define <2 x double> @test_pow_v2f64_x_known_positive
1213; CHECK-SAME: (<2 x double> nofpclass(ninf nsub nnorm) [[X:%.*]], <2 x double> [[Y:%.*]]) {
1214; CHECK-NEXT:    [[POW:%.*]] = tail call <2 x double> @_Z4powrDv2_dS_(<2 x double> [[X]], <2 x double> [[Y]])
1215; CHECK-NEXT:    ret <2 x double> [[POW]]
1216;
1217  %pow = tail call <2 x double> @_Z3powDv2_dS_(<2 x double> %x, <2 x double> %y)
1218  ret <2 x double> %pow
1219}
1220
1221define <2 x double> @test_pow_afn_v2f64_x_known_positive(<2 x double> nofpclass(ninf nnorm nsub) %x, <2 x double> %y) {
1222; CHECK-LABEL: define <2 x double> @test_pow_afn_v2f64_x_known_positive
1223; CHECK-SAME: (<2 x double> nofpclass(ninf nsub nnorm) [[X:%.*]], <2 x double> [[Y:%.*]]) {
1224; CHECK-NEXT:    [[POW:%.*]] = tail call afn <2 x double> @_Z4powrDv2_dS_(<2 x double> [[X]], <2 x double> [[Y]])
1225; CHECK-NEXT:    ret <2 x double> [[POW]]
1226;
1227  %pow = tail call afn <2 x double> @_Z3powDv2_dS_(<2 x double> %x, <2 x double> %y)
1228  ret <2 x double> %pow
1229}
1230
1231define half @test_pow_afn_f16_nnan_x_known_positive(half nofpclass(ninf nnorm nsub) %x, half %y) {
1232; CHECK-LABEL: define half @test_pow_afn_f16_nnan_x_known_positive
1233; CHECK-SAME: (half nofpclass(ninf nsub nnorm) [[X:%.*]], half [[Y:%.*]]) {
1234; CHECK-NEXT:    [[POW:%.*]] = tail call nnan afn half @_Z4powrDhDh(half [[X]], half [[Y]])
1235; CHECK-NEXT:    ret half [[POW]]
1236;
1237  %pow = tail call afn nnan half @_Z3powDhDh(half %x, half %y)
1238  ret half %pow
1239}
1240
1241define half @test_pow_afn_f16_nnan_ninf_x_known_positive(half nofpclass(ninf nnorm nsub) %x, half %y) {
1242; CHECK-LABEL: define half @test_pow_afn_f16_nnan_ninf_x_known_positive
1243; CHECK-SAME: (half nofpclass(ninf nsub nnorm) [[X:%.*]], half [[Y:%.*]]) {
1244; CHECK-NEXT:    [[__LOG2:%.*]] = call nnan ninf afn half @llvm.log2.f16(half [[X]])
1245; CHECK-NEXT:    [[__YLOGX:%.*]] = fmul nnan ninf afn half [[Y]], [[__LOG2]]
1246; CHECK-NEXT:    [[__EXP2:%.*]] = call nnan ninf afn half @llvm.exp2.f16(half [[__YLOGX]])
1247; CHECK-NEXT:    ret half [[__EXP2]]
1248;
1249  %pow = tail call afn nnan ninf half @_Z3powDhDh(half %x, half %y)
1250  ret half %pow
1251}
1252
1253define <2 x half> @test_pow_afn_v2f16_nnan_x_known_positive(<2 x half> nofpclass(ninf nnorm nsub) %x, <2 x half> %y) {
1254; CHECK-LABEL: define <2 x half> @test_pow_afn_v2f16_nnan_x_known_positive
1255; CHECK-SAME: (<2 x half> nofpclass(ninf nsub nnorm) [[X:%.*]], <2 x half> [[Y:%.*]]) {
1256; CHECK-NEXT:    [[POW:%.*]] = tail call nnan afn <2 x half> @_Z4powrDv2_DhS_(<2 x half> [[X]], <2 x half> [[Y]])
1257; CHECK-NEXT:    ret <2 x half> [[POW]]
1258;
1259  %pow = tail call afn nnan <2 x half> @_Z3powDv2_DhS_(<2 x half> %x, <2 x half> %y)
1260  ret <2 x half> %pow
1261}
1262
1263define <2 x half> @test_pow_afn_v2f16_nnan_ninf_x_known_positive(<2 x half> nofpclass(ninf nnorm nsub) %x, <2 x half> %y) {
1264; CHECK-LABEL: define <2 x half> @test_pow_afn_v2f16_nnan_ninf_x_known_positive
1265; CHECK-SAME: (<2 x half> nofpclass(ninf nsub nnorm) [[X:%.*]], <2 x half> [[Y:%.*]]) {
1266; CHECK-NEXT:    [[__LOG2:%.*]] = call nnan ninf afn <2 x half> @llvm.log2.v2f16(<2 x half> [[X]])
1267; CHECK-NEXT:    [[__YLOGX:%.*]] = fmul nnan ninf afn <2 x half> [[Y]], [[__LOG2]]
1268; CHECK-NEXT:    [[__EXP2:%.*]] = call nnan ninf afn <2 x half> @llvm.exp2.v2f16(<2 x half> [[__YLOGX]])
1269; CHECK-NEXT:    ret <2 x half> [[__EXP2]]
1270;
1271  %pow = tail call afn nnan ninf <2 x half> @_Z3powDv2_DhS_(<2 x half> %x, <2 x half> %y)
1272  ret <2 x half> %pow
1273}
1274
1275define half @test_pow_f16_x_known_positive(half nofpclass(ninf nnorm nsub) %x, half %y) {
1276; CHECK-LABEL: define half @test_pow_f16_x_known_positive
1277; CHECK-SAME: (half nofpclass(ninf nsub nnorm) [[X:%.*]], half [[Y:%.*]]) {
1278; CHECK-NEXT:    [[POW:%.*]] = tail call half @_Z4powrDhDh(half [[X]], half [[Y]])
1279; CHECK-NEXT:    ret half [[POW]]
1280;
1281  %pow = tail call half @_Z3powDhDh(half %x, half %y)
1282  ret half %pow
1283}
1284
1285define half @test_pow_afn_f16_x_known_positive(half nofpclass(ninf nnorm nsub) %x, half %y) {
1286; CHECK-LABEL: define half @test_pow_afn_f16_x_known_positive
1287; CHECK-SAME: (half nofpclass(ninf nsub nnorm) [[X:%.*]], half [[Y:%.*]]) {
1288; CHECK-NEXT:    [[POW:%.*]] = tail call afn half @_Z4powrDhDh(half [[X]], half [[Y]])
1289; CHECK-NEXT:    ret half [[POW]]
1290;
1291  %pow = tail call afn half @_Z3powDhDh(half %x, half %y)
1292  ret half %pow
1293}
1294
1295define <2 x half> @test_pow_v2f16_x_known_positive(<2 x half> nofpclass(ninf nnorm nsub) %x, <2 x half> %y) {
1296; CHECK-LABEL: define <2 x half> @test_pow_v2f16_x_known_positive
1297; CHECK-SAME: (<2 x half> nofpclass(ninf nsub nnorm) [[X:%.*]], <2 x half> [[Y:%.*]]) {
1298; CHECK-NEXT:    [[POW:%.*]] = tail call <2 x half> @_Z4powrDv2_DhS_(<2 x half> [[X]], <2 x half> [[Y]])
1299; CHECK-NEXT:    ret <2 x half> [[POW]]
1300;
1301  %pow = tail call <2 x half> @_Z3powDv2_DhS_(<2 x half> %x, <2 x half> %y)
1302  ret <2 x half> %pow
1303}
1304
1305define <2 x half> @test_pow_afn_v2f16_x_known_positive(<2 x half> nofpclass(ninf nnorm nsub) %x, <2 x half> %y) {
1306; CHECK-LABEL: define <2 x half> @test_pow_afn_v2f16_x_known_positive
1307; CHECK-SAME: (<2 x half> nofpclass(ninf nsub nnorm) [[X:%.*]], <2 x half> [[Y:%.*]]) {
1308; CHECK-NEXT:    [[POW:%.*]] = tail call afn <2 x half> @_Z4powrDv2_DhS_(<2 x half> [[X]], <2 x half> [[Y]])
1309; CHECK-NEXT:    ret <2 x half> [[POW]]
1310;
1311  %pow = tail call afn <2 x half> @_Z3powDv2_DhS_(<2 x half> %x, <2 x half> %y)
1312  ret <2 x half> %pow
1313}
1314
1315define float @test_pow_f32__y_0(float %x) {
1316; CHECK-LABEL: define float @test_pow_f32__y_0
1317; CHECK-SAME: (float [[X:%.*]]) {
1318; CHECK-NEXT:    ret float 1.000000e+00
1319;
1320  %pow = tail call float @_Z3powff(float %x, float 0.0)
1321  ret float %pow
1322}
1323
1324define float @test_pow_f32__y_n0(float %x) {
1325; CHECK-LABEL: define float @test_pow_f32__y_n0
1326; CHECK-SAME: (float [[X:%.*]]) {
1327; CHECK-NEXT:    ret float 1.000000e+00
1328;
1329  %pow = tail call float @_Z3powff(float %x, float -0.0)
1330  ret float %pow
1331}
1332
1333define float @test_pow_f32__y_1(float %x) {
1334; CHECK-LABEL: define float @test_pow_f32__y_1
1335; CHECK-SAME: (float [[X:%.*]]) {
1336; CHECK-NEXT:    ret float [[X]]
1337;
1338  %pow = tail call float @_Z3powff(float %x, float 1.0)
1339  ret float %pow
1340}
1341
1342define float @test_pow_f32__y_n1(float %x) {
1343; CHECK-LABEL: define float @test_pow_f32__y_n1
1344; CHECK-SAME: (float [[X:%.*]]) {
1345; CHECK-NEXT:    [[__POWRECIP:%.*]] = fdiv float 1.000000e+00, [[X]]
1346; CHECK-NEXT:    ret float [[__POWRECIP]]
1347;
1348  %pow = tail call float @_Z3powff(float %x, float -1.0)
1349  ret float %pow
1350}
1351
1352define float @test_pow_f32__y_2(float %x) {
1353; CHECK-LABEL: define float @test_pow_f32__y_2
1354; CHECK-SAME: (float [[X:%.*]]) {
1355; CHECK-NEXT:    [[__POW2:%.*]] = fmul float [[X]], [[X]]
1356; CHECK-NEXT:    ret float [[__POW2]]
1357;
1358  %pow = tail call float @_Z3powff(float %x, float 2.0)
1359  ret float %pow
1360}
1361
1362define float @test_pow_f32__y_n2(float %x) {
1363; CHECK-LABEL: define float @test_pow_f32__y_n2
1364; CHECK-SAME: (float [[X:%.*]]) {
1365; CHECK-NEXT:    [[POW:%.*]] = tail call float @_Z4pownfi(float [[X]], i32 -2)
1366; CHECK-NEXT:    ret float [[POW]]
1367;
1368  %pow = tail call float @_Z3powff(float %x, float -2.0)
1369  ret float %pow
1370}
1371
1372define float @test_pow_f32__y_half(float %x) {
1373; CHECK-LABEL: define float @test_pow_f32__y_half
1374; CHECK-SAME: (float [[X:%.*]]) {
1375; CHECK-NEXT:    [[__POW2SQRT:%.*]] = call float @_Z4sqrtf(float [[X]])
1376; CHECK-NEXT:    ret float [[__POW2SQRT]]
1377;
1378  %pow = tail call float @_Z3powff(float %x, float 0.5)
1379  ret float %pow
1380}
1381
1382define float @test_pow_f32__y_neg_half(float %x) {
1383; CHECK-LABEL: define float @test_pow_f32__y_neg_half
1384; CHECK-SAME: (float [[X:%.*]]) {
1385; CHECK-NEXT:    [[__POW2RSQRT:%.*]] = call float @_Z5rsqrtf(float [[X]])
1386; CHECK-NEXT:    ret float [[__POW2RSQRT]]
1387;
1388  %pow = tail call float @_Z3powff(float %x, float -0.5)
1389  ret float %pow
1390}
1391
1392define float @test_pow_f32__y_3(float %x) {
1393; CHECK-LABEL: define float @test_pow_f32__y_3
1394; CHECK-SAME: (float [[X:%.*]]) {
1395; CHECK-NEXT:    [[POW:%.*]] = tail call float @_Z4pownfi(float [[X]], i32 3)
1396; CHECK-NEXT:    ret float [[POW]]
1397;
1398  %pow = tail call float @_Z3powff(float %x, float 3.0)
1399  ret float %pow
1400}
1401
1402define float @test_pow_f32__y_n3(float %x) {
1403; CHECK-LABEL: define float @test_pow_f32__y_n3
1404; CHECK-SAME: (float [[X:%.*]]) {
1405; CHECK-NEXT:    [[POW:%.*]] = tail call float @_Z4pownfi(float [[X]], i32 -3)
1406; CHECK-NEXT:    ret float [[POW]]
1407;
1408  %pow = tail call float @_Z3powff(float %x, float -3.0)
1409  ret float %pow
1410}
1411
1412define float @test_pow_f32__y_2_5(float %x) {
1413; CHECK-LABEL: define float @test_pow_f32__y_2_5
1414; CHECK-SAME: (float [[X:%.*]]) {
1415; CHECK-NEXT:    [[POW:%.*]] = tail call float @_Z3powff(float [[X]], float 2.500000e+00)
1416; CHECK-NEXT:    ret float [[POW]]
1417;
1418  %pow = tail call float @_Z3powff(float %x, float 2.5)
1419  ret float %pow
1420}
1421
1422define float @test_pow_f32__y_n_2_5(float %x) {
1423; CHECK-LABEL: define float @test_pow_f32__y_n_2_5
1424; CHECK-SAME: (float [[X:%.*]]) {
1425; CHECK-NEXT:    [[POW:%.*]] = tail call float @_Z3powff(float [[X]], float -2.500000e+00)
1426; CHECK-NEXT:    ret float [[POW]]
1427;
1428  %pow = tail call float @_Z3powff(float %x, float -2.5)
1429  ret float %pow
1430}
1431
1432define <2 x float> @test_pow_v2f32__y_0(<2 x float> %x) {
1433; CHECK-LABEL: define <2 x float> @test_pow_v2f32__y_0
1434; CHECK-SAME: (<2 x float> [[X:%.*]]) {
1435; CHECK-NEXT:    ret <2 x float> splat (float 1.000000e+00)
1436;
1437  %pow = tail call <2 x float> @_Z3powDv2_fS_(<2 x float> %x, <2 x float> zeroinitializer)
1438  ret <2 x float> %pow
1439}
1440
1441define <2 x float> @test_pow_v2f32__y_n0(<2 x float> %x) {
1442; CHECK-LABEL: define <2 x float> @test_pow_v2f32__y_n0
1443; CHECK-SAME: (<2 x float> [[X:%.*]]) {
1444; CHECK-NEXT:    ret <2 x float> splat (float 1.000000e+00)
1445;
1446  %pow = tail call <2 x float> @_Z3powDv2_fS_(<2 x float> %x, <2 x float> <float -0.0, float -0.0>)
1447  ret <2 x float> %pow
1448}
1449
1450define <2 x float> @test_pow_v2f32__y_1(<2 x float> %x) {
1451; CHECK-LABEL: define <2 x float> @test_pow_v2f32__y_1
1452; CHECK-SAME: (<2 x float> [[X:%.*]]) {
1453; CHECK-NEXT:    ret <2 x float> [[X]]
1454;
1455  %pow = tail call <2 x float> @_Z3powDv2_fS_(<2 x float> %x, <2 x float> <float 1.0,float 1.0>)
1456  ret <2 x float> %pow
1457}
1458
1459define <2 x float> @test_pow_v2f32__y_n1(<2 x float> %x) {
1460; CHECK-LABEL: define <2 x float> @test_pow_v2f32__y_n1
1461; CHECK-SAME: (<2 x float> [[X:%.*]]) {
1462; CHECK-NEXT:    [[__POWRECIP:%.*]] = fdiv <2 x float> splat (float 1.000000e+00), [[X]]
1463; CHECK-NEXT:    ret <2 x float> [[__POWRECIP]]
1464;
1465  %pow = tail call <2 x float> @_Z3powDv2_fS_(<2 x float> %x, <2 x float> <float -1.0, float -1.0>)
1466  ret <2 x float> %pow
1467}
1468
1469define <2 x float> @test_pow_v2f32__y_2(<2 x float> %x) {
1470; CHECK-LABEL: define <2 x float> @test_pow_v2f32__y_2
1471; CHECK-SAME: (<2 x float> [[X:%.*]]) {
1472; CHECK-NEXT:    [[__POW2:%.*]] = fmul <2 x float> [[X]], [[X]]
1473; CHECK-NEXT:    ret <2 x float> [[__POW2]]
1474;
1475  %pow = tail call <2 x float> @_Z3powDv2_fS_(<2 x float> %x, <2 x float> <float 2.0, float 2.0>)
1476  ret <2 x float> %pow
1477}
1478
1479define <2 x float> @test_pow_v2f32__y_n2(<2 x float> %x) {
1480; CHECK-LABEL: define <2 x float> @test_pow_v2f32__y_n2
1481; CHECK-SAME: (<2 x float> [[X:%.*]]) {
1482; CHECK-NEXT:    [[POW:%.*]] = tail call <2 x float> @_Z4pownDv2_fDv2_i(<2 x float> [[X]], <2 x i32> splat (i32 -2))
1483; CHECK-NEXT:    ret <2 x float> [[POW]]
1484;
1485  %pow = tail call <2 x float> @_Z3powDv2_fS_(<2 x float> %x, <2 x float> <float -2.0, float -2.0>)
1486  ret <2 x float> %pow
1487}
1488
1489define <2 x float> @test_pow_v2f32__y_half(<2 x float> %x) {
1490; CHECK-LABEL: define <2 x float> @test_pow_v2f32__y_half
1491; CHECK-SAME: (<2 x float> [[X:%.*]]) {
1492; CHECK-NEXT:    [[__POW2SQRT:%.*]] = call <2 x float> @_Z4sqrtDv2_f(<2 x float> [[X]])
1493; CHECK-NEXT:    ret <2 x float> [[__POW2SQRT]]
1494;
1495  %pow = tail call <2 x float> @_Z3powDv2_fS_(<2 x float> %x, <2 x float> <float 0.5, float 0.5>)
1496  ret <2 x float> %pow
1497}
1498
1499define <2 x float> @test_pow_v2f32__y_neg_half(<2 x float> %x) {
1500; CHECK-LABEL: define <2 x float> @test_pow_v2f32__y_neg_half
1501; CHECK-SAME: (<2 x float> [[X:%.*]]) {
1502; CHECK-NEXT:    [[__POW2RSQRT:%.*]] = call <2 x float> @_Z5rsqrtDv2_f(<2 x float> [[X]])
1503; CHECK-NEXT:    ret <2 x float> [[__POW2RSQRT]]
1504;
1505  %pow = tail call <2 x float> @_Z3powDv2_fS_(<2 x float> %x, <2 x float> <float -0.5, float -0.5>)
1506  ret <2 x float> %pow
1507}
1508
1509define <2 x float> @test_pow_v2f32__y_3(<2 x float> %x) {
1510; CHECK-LABEL: define <2 x float> @test_pow_v2f32__y_3
1511; CHECK-SAME: (<2 x float> [[X:%.*]]) {
1512; CHECK-NEXT:    [[POW:%.*]] = tail call <2 x float> @_Z4pownDv2_fDv2_i(<2 x float> [[X]], <2 x i32> splat (i32 3))
1513; CHECK-NEXT:    ret <2 x float> [[POW]]
1514;
1515  %pow = tail call <2 x float> @_Z3powDv2_fS_(<2 x float> %x, <2 x float> <float 3.0, float 3.0>)
1516  ret <2 x float> %pow
1517}
1518
1519define <2 x float> @test_pow_v2f32__y_n3(<2 x float> %x) {
1520; CHECK-LABEL: define <2 x float> @test_pow_v2f32__y_n3
1521; CHECK-SAME: (<2 x float> [[X:%.*]]) {
1522; CHECK-NEXT:    [[POW:%.*]] = tail call <2 x float> @_Z4pownDv2_fDv2_i(<2 x float> [[X]], <2 x i32> splat (i32 -3))
1523; CHECK-NEXT:    ret <2 x float> [[POW]]
1524;
1525  %pow = tail call <2 x float> @_Z3powDv2_fS_(<2 x float> %x, <2 x float> <float -3.0,float -3.0>)
1526  ret <2 x float> %pow
1527}
1528
1529define <2 x float> @test_pow_v2f32__y_2_5(<2 x float> %x) {
1530; CHECK-LABEL: define <2 x float> @test_pow_v2f32__y_2_5
1531; CHECK-SAME: (<2 x float> [[X:%.*]]) {
1532; CHECK-NEXT:    [[POW:%.*]] = tail call <2 x float> @_Z3powDv2_fS_(<2 x float> [[X]], <2 x float> splat (float 2.500000e+00))
1533; CHECK-NEXT:    ret <2 x float> [[POW]]
1534;
1535  %pow = tail call <2 x float> @_Z3powDv2_fS_(<2 x float> %x, <2 x float> <float 2.5, float 2.5>)
1536  ret <2 x float> %pow
1537}
1538
1539define <2 x float> @test_pow_v2f32__y_n_2_5(<2 x float> %x) {
1540; CHECK-LABEL: define <2 x float> @test_pow_v2f32__y_n_2_5
1541; CHECK-SAME: (<2 x float> [[X:%.*]]) {
1542; CHECK-NEXT:    [[POW:%.*]] = tail call <2 x float> @_Z3powDv2_fS_(<2 x float> [[X]], <2 x float> splat (float -2.500000e+00))
1543; CHECK-NEXT:    ret <2 x float> [[POW]]
1544;
1545  %pow = tail call <2 x float> @_Z3powDv2_fS_(<2 x float> %x, <2 x float> <float -2.5, float -2.5>)
1546  ret <2 x float> %pow
1547}
1548
1549define float @test_pow_f32__known_positive__y_0(float nofpclass(ninf nnorm nsub) %x) {
1550; CHECK-LABEL: define float @test_pow_f32__known_positive__y_0
1551; CHECK-SAME: (float nofpclass(ninf nsub nnorm) [[X:%.*]]) {
1552; CHECK-NEXT:    ret float 1.000000e+00
1553;
1554  %pow = tail call float @_Z3powff(float %x, float 0.0)
1555  ret float %pow
1556}
1557
1558define float @test_pow_f32__known_positive__y_1(float nofpclass(ninf nnorm nsub) %x) {
1559; CHECK-LABEL: define float @test_pow_f32__known_positive__y_1
1560; CHECK-SAME: (float nofpclass(ninf nsub nnorm) [[X:%.*]]) {
1561; CHECK-NEXT:    ret float [[X]]
1562;
1563  %pow = tail call float @_Z3powff(float %x, float 1.0)
1564  ret float %pow
1565}
1566
1567define float @test_pow_f32__known_positive__y_neg1(float nofpclass(ninf nnorm nsub) %x) {
1568; CHECK-LABEL: define float @test_pow_f32__known_positive__y_neg1
1569; CHECK-SAME: (float nofpclass(ninf nsub nnorm) [[X:%.*]]) {
1570; CHECK-NEXT:    [[__POWRECIP:%.*]] = fdiv float 1.000000e+00, [[X]]
1571; CHECK-NEXT:    ret float [[__POWRECIP]]
1572;
1573  %pow = tail call float @_Z3powff(float %x, float -1.0)
1574  ret float %pow
1575}
1576
1577define float @test_pow_f32__known_positive__y_2(float nofpclass(ninf nnorm nsub) %x) {
1578; CHECK-LABEL: define float @test_pow_f32__known_positive__y_2
1579; CHECK-SAME: (float nofpclass(ninf nsub nnorm) [[X:%.*]]) {
1580; CHECK-NEXT:    [[__POW2:%.*]] = fmul float [[X]], [[X]]
1581; CHECK-NEXT:    ret float [[__POW2]]
1582;
1583  %pow = tail call float @_Z3powff(float %x, float 2.0)
1584  ret float %pow
1585}
1586
1587define float @test_pow_f32__known_positive__y_half(float nofpclass(ninf nnorm nsub) %x) {
1588; CHECK-LABEL: define float @test_pow_f32__known_positive__y_half
1589; CHECK-SAME: (float nofpclass(ninf nsub nnorm) [[X:%.*]]) {
1590; CHECK-NEXT:    [[__POW2SQRT:%.*]] = call float @_Z4sqrtf(float [[X]])
1591; CHECK-NEXT:    ret float [[__POW2SQRT]]
1592;
1593  %pow = tail call float @_Z3powff(float %x, float 0.5)
1594  ret float %pow
1595}
1596
1597define float @test_pow_f32__known_positive__y_neghalf(float nofpclass(ninf nnorm nsub) %x) {
1598; CHECK-LABEL: define float @test_pow_f32__known_positive__y_neghalf
1599; CHECK-SAME: (float nofpclass(ninf nsub nnorm) [[X:%.*]]) {
1600; CHECK-NEXT:    [[__POW2RSQRT:%.*]] = call float @_Z5rsqrtf(float [[X]])
1601; CHECK-NEXT:    ret float [[__POW2RSQRT]]
1602;
1603  %pow = tail call float @_Z3powff(float %x, float -0.5)
1604  ret float %pow
1605}
1606
1607define float @test_pow_f32_x_assumed_oge_0(float %x, float %y) {
1608; CHECK-LABEL: define float @test_pow_f32_x_assumed_oge_0
1609; CHECK-SAME: (float [[X:%.*]], float [[Y:%.*]]) {
1610; CHECK-NEXT:    [[X_OGE_ZERO:%.*]] = fcmp oge float [[X]], 0.000000e+00
1611; CHECK-NEXT:    call void @llvm.assume(i1 [[X_OGE_ZERO]])
1612; CHECK-NEXT:    [[POW:%.*]] = tail call float @_Z4powrff(float [[X]], float [[Y]])
1613; CHECK-NEXT:    ret float [[POW]]
1614;
1615  %x.oge.zero = fcmp oge float %x, 0.0
1616  call void @llvm.assume(i1 %x.oge.zero)
1617  %pow = tail call float @_Z3powff(float %x, float %y)
1618  ret float %pow
1619}
1620
1621define float @test_pow_f32_x_assumed_ogt_0(float %x, float %y) {
1622; CHECK-LABEL: define float @test_pow_f32_x_assumed_ogt_0
1623; CHECK-SAME: (float [[X:%.*]], float [[Y:%.*]]) {
1624; CHECK-NEXT:    [[X_OGE_ZERO:%.*]] = fcmp ogt float [[X]], 0.000000e+00
1625; CHECK-NEXT:    call void @llvm.assume(i1 [[X_OGE_ZERO]])
1626; CHECK-NEXT:    [[POW:%.*]] = tail call float @_Z4powrff(float [[X]], float [[Y]])
1627; CHECK-NEXT:    ret float [[POW]]
1628;
1629  %x.oge.zero = fcmp ogt float %x, 0.0
1630  call void @llvm.assume(i1 %x.oge.zero)
1631  %pow = tail call float @_Z3powff(float %x, float %y)
1632  ret float %pow
1633}
1634
1635define float @test_pow_f32_x_assumed_uge_0(float %x, float %y) {
1636; CHECK-LABEL: define float @test_pow_f32_x_assumed_uge_0
1637; CHECK-SAME: (float [[X:%.*]], float [[Y:%.*]]) {
1638; CHECK-NEXT:    [[X_UGE_ZERO:%.*]] = fcmp uge float [[X]], 0.000000e+00
1639; CHECK-NEXT:    call void @llvm.assume(i1 [[X_UGE_ZERO]])
1640; CHECK-NEXT:    [[POW:%.*]] = tail call float @_Z4powrff(float [[X]], float [[Y]])
1641; CHECK-NEXT:    ret float [[POW]]
1642;
1643  %x.uge.zero = fcmp uge float %x, 0.0
1644  call void @llvm.assume(i1 %x.uge.zero)
1645  %pow = tail call float @_Z3powff(float %x, float %y)
1646  ret float %pow
1647}
1648
1649define float @test_pow_f32_x_assumed_ugt_0(float %x, float %y) {
1650; CHECK-LABEL: define float @test_pow_f32_x_assumed_ugt_0
1651; CHECK-SAME: (float [[X:%.*]], float [[Y:%.*]]) {
1652; CHECK-NEXT:    [[X_UGT_ZERO:%.*]] = fcmp ugt float [[X]], 0.000000e+00
1653; CHECK-NEXT:    call void @llvm.assume(i1 [[X_UGT_ZERO]])
1654; CHECK-NEXT:    [[POW:%.*]] = tail call float @_Z4powrff(float [[X]], float [[Y]])
1655; CHECK-NEXT:    ret float [[POW]]
1656;
1657  %x.ugt.zero = fcmp ugt float %x, 0.0
1658  call void @llvm.assume(i1 %x.ugt.zero)
1659  %pow = tail call float @_Z3powff(float %x, float %y)
1660  ret float %pow
1661}
1662
1663define float @test_pow_afn_f32__y_poison(float %x) {
1664; CHECK-LABEL: define float @test_pow_afn_f32__y_poison
1665; CHECK-SAME: (float [[X:%.*]]) {
1666; CHECK-NEXT:    [[POW:%.*]] = tail call afn float @_Z4pownfi(float [[X]], i32 poison)
1667; CHECK-NEXT:    ret float [[POW]]
1668;
1669  %pow = tail call afn float @_Z3powff(float %x, float poison)
1670  ret float %pow
1671}
1672
1673define float @test_pow_afn_f32__y_3(float %x) {
1674; CHECK-LABEL: define float @test_pow_afn_f32__y_3
1675; CHECK-SAME: (float [[X:%.*]]) {
1676; CHECK-NEXT:    [[POW:%.*]] = tail call afn float @_Z4pownfi(float [[X]], i32 3)
1677; CHECK-NEXT:    ret float [[POW]]
1678;
1679  %pow = tail call afn float @_Z3powff(float %x, float 3.0)
1680  ret float %pow
1681}
1682
1683define float @test_pow_afn_f32_nnan_ninf__y_3(float %x) {
1684; CHECK-LABEL: define float @test_pow_afn_f32_nnan_ninf__y_3
1685; CHECK-SAME: (float [[X:%.*]]) {
1686; CHECK-NEXT:    [[__POWX2:%.*]] = fmul nnan ninf afn float [[X]], [[X]]
1687; CHECK-NEXT:    [[__POWPROD:%.*]] = fmul nnan ninf afn float [[X]], [[__POWX2]]
1688; CHECK-NEXT:    ret float [[__POWPROD]]
1689;
1690  %pow = tail call afn nnan ninf float @_Z3powff(float %x, float 3.0)
1691  ret float %pow
1692}
1693
1694define float @test_pow_afn_f32__y_4(float %x) {
1695; CHECK-LABEL: define float @test_pow_afn_f32__y_4
1696; CHECK-SAME: (float [[X:%.*]]) {
1697; CHECK-NEXT:    [[POW:%.*]] = tail call afn float @_Z4pownfi(float [[X]], i32 4)
1698; CHECK-NEXT:    ret float [[POW]]
1699;
1700  %pow = tail call afn float @_Z3powff(float %x, float 4.0)
1701  ret float %pow
1702}
1703
1704define float @test_pow_afn_f32_nnan_ninf__y_4(float %x) {
1705; CHECK-LABEL: define float @test_pow_afn_f32_nnan_ninf__y_4
1706; CHECK-SAME: (float [[X:%.*]]) {
1707; CHECK-NEXT:    [[__POWX2:%.*]] = fmul nnan ninf afn float [[X]], [[X]]
1708; CHECK-NEXT:    [[__POWX21:%.*]] = fmul nnan ninf afn float [[__POWX2]], [[__POWX2]]
1709; CHECK-NEXT:    ret float [[__POWX21]]
1710;
1711  %pow = tail call afn nnan ninf float @_Z3powff(float %x, float 4.0)
1712  ret float %pow
1713}
1714
1715define float @test_pow_afn_f32_nnan_ninf__y_4_5(float %x) {
1716; CHECK-LABEL: define float @test_pow_afn_f32_nnan_ninf__y_4_5
1717; CHECK-SAME: (float [[X:%.*]]) {
1718; CHECK-NEXT:    [[POW:%.*]] = tail call nnan ninf afn float @_Z3powff(float [[X]], float 4.500000e+00)
1719; CHECK-NEXT:    ret float [[POW]]
1720;
1721  %pow = tail call afn nnan ninf float @_Z3powff(float %x, float 4.5)
1722  ret float %pow
1723}
1724
1725define float @test_pow_afn_f32__y_5(float %x) {
1726; CHECK-LABEL: define float @test_pow_afn_f32__y_5
1727; CHECK-SAME: (float [[X:%.*]]) {
1728; CHECK-NEXT:    [[POW:%.*]] = tail call afn float @_Z4pownfi(float [[X]], i32 5)
1729; CHECK-NEXT:    ret float [[POW]]
1730;
1731  %pow = tail call afn float @_Z3powff(float %x, float 5.0)
1732  ret float %pow
1733}
1734
1735define float @test_pow_afn_f32_nnan_ninf__y_5(float %x) {
1736; CHECK-LABEL: define float @test_pow_afn_f32_nnan_ninf__y_5
1737; CHECK-SAME: (float [[X:%.*]]) {
1738; CHECK-NEXT:    [[__POWX2:%.*]] = fmul nnan ninf afn float [[X]], [[X]]
1739; CHECK-NEXT:    [[__POWX21:%.*]] = fmul nnan ninf afn float [[__POWX2]], [[__POWX2]]
1740; CHECK-NEXT:    [[__POWPROD:%.*]] = fmul nnan ninf afn float [[X]], [[__POWX21]]
1741; CHECK-NEXT:    ret float [[__POWPROD]]
1742;
1743  %pow = tail call afn nnan ninf float @_Z3powff(float %x, float 5.0)
1744  ret float %pow
1745}
1746
1747define float @test_pow_afn_f32__y_neg5(float %x) {
1748; CHECK-LABEL: define float @test_pow_afn_f32__y_neg5
1749; CHECK-SAME: (float [[X:%.*]]) {
1750; CHECK-NEXT:    [[POW:%.*]] = tail call afn float @_Z4pownfi(float [[X]], i32 -5)
1751; CHECK-NEXT:    ret float [[POW]]
1752;
1753  %pow = tail call afn float @_Z3powff(float %x, float -5.0)
1754  ret float %pow
1755}
1756
1757define float @test_pow_afn_f32_nnan_ninf__y_neg5(float %x) {
1758; CHECK-LABEL: define float @test_pow_afn_f32_nnan_ninf__y_neg5
1759; CHECK-SAME: (float [[X:%.*]]) {
1760; CHECK-NEXT:    [[__POWX2:%.*]] = fmul nnan ninf afn float [[X]], [[X]]
1761; CHECK-NEXT:    [[__POWX21:%.*]] = fmul nnan ninf afn float [[__POWX2]], [[__POWX2]]
1762; CHECK-NEXT:    [[__POWPROD:%.*]] = fmul nnan ninf afn float [[X]], [[__POWX21]]
1763; CHECK-NEXT:    [[__1POWPROD:%.*]] = fdiv nnan ninf afn float 1.000000e+00, [[__POWPROD]]
1764; CHECK-NEXT:    ret float [[__1POWPROD]]
1765;
1766  %pow = tail call afn nnan ninf float @_Z3powff(float %x, float -5.0)
1767  ret float %pow
1768}
1769
1770define float @test_pow_afn_f32_nnan_ninf__y_10(float %x) {
1771; CHECK-LABEL: define float @test_pow_afn_f32_nnan_ninf__y_10
1772; CHECK-SAME: (float [[X:%.*]]) {
1773; CHECK-NEXT:    [[__POWX2:%.*]] = fmul nnan ninf afn float [[X]], [[X]]
1774; CHECK-NEXT:    [[__POWX21:%.*]] = fmul nnan ninf afn float [[__POWX2]], [[__POWX2]]
1775; CHECK-NEXT:    [[__POWX22:%.*]] = fmul nnan ninf afn float [[__POWX21]], [[__POWX21]]
1776; CHECK-NEXT:    [[__POWPROD:%.*]] = fmul nnan ninf afn float [[__POWX2]], [[__POWX22]]
1777; CHECK-NEXT:    ret float [[__POWPROD]]
1778;
1779  %pow = tail call afn nnan ninf float @_Z3powff(float %x, float 10.0)
1780  ret float %pow
1781}
1782
1783define <2 x float> @test_pow_afn_v2f32_nnan_ninf__y_poison(<2 x float> %x) {
1784; CHECK-LABEL: define <2 x float> @test_pow_afn_v2f32_nnan_ninf__y_poison
1785; CHECK-SAME: (<2 x float> [[X:%.*]]) {
1786; CHECK-NEXT:    ret <2 x float> poison
1787;
1788  %pow = tail call afn nnan ninf <2 x float> @_Z3powDv2_fS_(<2 x float> %x, <2 x float> poison)
1789  ret <2 x float> %pow
1790}
1791
1792define <2 x float> @test_pow_afn_v2f32_nnan_ninf__y_3(<2 x float> %x) {
1793; CHECK-LABEL: define <2 x float> @test_pow_afn_v2f32_nnan_ninf__y_3
1794; CHECK-SAME: (<2 x float> [[X:%.*]]) {
1795; CHECK-NEXT:    [[__POWX2:%.*]] = fmul nnan ninf afn <2 x float> [[X]], [[X]]
1796; CHECK-NEXT:    [[__POWPROD:%.*]] = fmul nnan ninf afn <2 x float> [[X]], [[__POWX2]]
1797; CHECK-NEXT:    ret <2 x float> [[__POWPROD]]
1798;
1799  %pow = tail call afn nnan ninf <2 x float> @_Z3powDv2_fS_(<2 x float> %x, <2 x float> <float 3.0, float 3.0>)
1800  ret <2 x float> %pow
1801}
1802
1803define <2 x float> @test_pow_afn_v2f32_nnan_ninf__y_4(<2 x float> %x) {
1804; CHECK-LABEL: define <2 x float> @test_pow_afn_v2f32_nnan_ninf__y_4
1805; CHECK-SAME: (<2 x float> [[X:%.*]]) {
1806; CHECK-NEXT:    [[__POWX2:%.*]] = fmul nnan ninf afn <2 x float> [[X]], [[X]]
1807; CHECK-NEXT:    [[__POWX21:%.*]] = fmul nnan ninf afn <2 x float> [[__POWX2]], [[__POWX2]]
1808; CHECK-NEXT:    ret <2 x float> [[__POWX21]]
1809;
1810  %pow = tail call afn nnan ninf <2 x float> @_Z3powDv2_fS_(<2 x float> %x, <2 x float> <float 4.0, float 4.0>)
1811  ret <2 x float> %pow
1812}
1813
1814define <2 x float> @test_pow_afn_v2f32_nnan_ninf__y_4_5(<2 x float> %x) {
1815; CHECK-LABEL: define <2 x float> @test_pow_afn_v2f32_nnan_ninf__y_4_5
1816; CHECK-SAME: (<2 x float> [[X:%.*]]) {
1817; CHECK-NEXT:    [[POW:%.*]] = tail call nnan ninf afn <2 x float> @_Z3powDv2_fS_(<2 x float> [[X]], <2 x float> splat (float 4.500000e+00))
1818; CHECK-NEXT:    ret <2 x float> [[POW]]
1819;
1820  %pow = tail call afn nnan ninf <2 x float> @_Z3powDv2_fS_(<2 x float> %x, <2 x float> <float 4.5, float 4.5>)
1821  ret <2 x float> %pow
1822}
1823
1824define <2 x float> @test_pow_afn_v2f32_nnan_ninf__y_4_5_undef(<2 x float> %x) {
1825; CHECK-LABEL: define <2 x float> @test_pow_afn_v2f32_nnan_ninf__y_4_5_undef
1826; CHECK-SAME: (<2 x float> [[X:%.*]]) {
1827; CHECK-NEXT:    [[POW:%.*]] = tail call nnan ninf afn <2 x float> @_Z3powDv2_fS_(<2 x float> [[X]], <2 x float> <float 4.500000e+00, float poison>)
1828; CHECK-NEXT:    ret <2 x float> [[POW]]
1829;
1830  %pow = tail call afn nnan ninf <2 x float> @_Z3powDv2_fS_(<2 x float> %x, <2 x float> <float 4.5, float poison>)
1831  ret <2 x float> %pow
1832}
1833
1834define <2 x float> @test_pow_afn_v2f32_nnan_ninf__y_5(<2 x float> %x) {
1835; CHECK-LABEL: define <2 x float> @test_pow_afn_v2f32_nnan_ninf__y_5
1836; CHECK-SAME: (<2 x float> [[X:%.*]]) {
1837; CHECK-NEXT:    [[__POWX2:%.*]] = fmul nnan ninf afn <2 x float> [[X]], [[X]]
1838; CHECK-NEXT:    [[__POWX21:%.*]] = fmul nnan ninf afn <2 x float> [[__POWX2]], [[__POWX2]]
1839; CHECK-NEXT:    [[__POWPROD:%.*]] = fmul nnan ninf afn <2 x float> [[X]], [[__POWX21]]
1840; CHECK-NEXT:    ret <2 x float> [[__POWPROD]]
1841;
1842  %pow = tail call afn nnan ninf <2 x float> @_Z3powDv2_fS_(<2 x float> %x, <2 x float> <float 5.0, float 5.0>)
1843  ret <2 x float> %pow
1844}
1845
1846define float @test_pow_afn_f32_nnan_ninf__y_5_known_positive(float nofpclass(ninf nsub nnorm) %x) {
1847; CHECK-LABEL: define float @test_pow_afn_f32_nnan_ninf__y_5_known_positive
1848; CHECK-SAME: (float nofpclass(ninf nsub nnorm) [[X:%.*]]) {
1849; CHECK-NEXT:    [[__POWX2:%.*]] = fmul nnan ninf afn float [[X]], [[X]]
1850; CHECK-NEXT:    [[__POWX21:%.*]] = fmul nnan ninf afn float [[__POWX2]], [[__POWX2]]
1851; CHECK-NEXT:    [[__POWPROD:%.*]] = fmul nnan ninf afn float [[X]], [[__POWX21]]
1852; CHECK-NEXT:    ret float [[__POWPROD]]
1853;
1854  %pow = tail call afn nnan ninf float @_Z3powff(float %x, float 5.0)
1855  ret float %pow
1856}
1857
1858; we know we can ignore missing ninf on the input from the flag on the call
1859define float @test_pow_afn_f32_nnan_ninf__y_5_known_positive_with_ninf_flag(float nofpclass(nsub nnorm) %x) {
1860; CHECK-LABEL: define float @test_pow_afn_f32_nnan_ninf__y_5_known_positive_with_ninf_flag
1861; CHECK-SAME: (float nofpclass(nsub nnorm) [[X:%.*]]) {
1862; CHECK-NEXT:    [[__POWX2:%.*]] = fmul nnan ninf afn float [[X]], [[X]]
1863; CHECK-NEXT:    [[__POWX21:%.*]] = fmul nnan ninf afn float [[__POWX2]], [[__POWX2]]
1864; CHECK-NEXT:    [[__POWPROD:%.*]] = fmul nnan ninf afn float [[X]], [[__POWX21]]
1865; CHECK-NEXT:    ret float [[__POWPROD]]
1866;
1867  %pow = tail call afn nnan ninf float @_Z3powff(float %x, float 5.0)
1868  ret float %pow
1869}
1870
1871define double @test_pow_afn_f64__y_3(double %x) {
1872; CHECK-LABEL: define double @test_pow_afn_f64__y_3
1873; CHECK-SAME: (double [[X:%.*]]) {
1874; CHECK-NEXT:    [[POW:%.*]] = tail call afn double @_Z4powndi(double [[X]], i32 3)
1875; CHECK-NEXT:    ret double [[POW]]
1876;
1877  %pow = tail call afn double @_Z3powdd(double %x, double 3.0)
1878  ret double %pow
1879}
1880
1881define double @test_pow_afn_f64_nnan_ninf__y_3(double %x) {
1882; CHECK-LABEL: define double @test_pow_afn_f64_nnan_ninf__y_3
1883; CHECK-SAME: (double [[X:%.*]]) {
1884; CHECK-NEXT:    [[__POWX2:%.*]] = fmul nnan ninf afn double [[X]], [[X]]
1885; CHECK-NEXT:    [[__POWPROD:%.*]] = fmul nnan ninf afn double [[X]], [[__POWX2]]
1886; CHECK-NEXT:    ret double [[__POWPROD]]
1887;
1888  %pow = tail call afn nnan ninf double @_Z3powdd(double %x, double 3.0)
1889  ret double %pow
1890}
1891
1892define double @test_pow_afn_f64__y_4(double %x) {
1893; CHECK-LABEL: define double @test_pow_afn_f64__y_4
1894; CHECK-SAME: (double [[X:%.*]]) {
1895; CHECK-NEXT:    [[POW:%.*]] = tail call afn double @_Z4powndi(double [[X]], i32 4)
1896; CHECK-NEXT:    ret double [[POW]]
1897;
1898  %pow = tail call afn double @_Z3powdd(double %x, double 4.0)
1899  ret double %pow
1900}
1901
1902define double @test_pow_afn_f64_nnan_ninf__y_4(double %x) {
1903; CHECK-LABEL: define double @test_pow_afn_f64_nnan_ninf__y_4
1904; CHECK-SAME: (double [[X:%.*]]) {
1905; CHECK-NEXT:    [[__POWX2:%.*]] = fmul nnan ninf afn double [[X]], [[X]]
1906; CHECK-NEXT:    [[__POWX21:%.*]] = fmul nnan ninf afn double [[__POWX2]], [[__POWX2]]
1907; CHECK-NEXT:    ret double [[__POWX21]]
1908;
1909  %pow = tail call afn nnan ninf double @_Z3powdd(double %x, double 4.0)
1910  ret double %pow
1911}
1912
1913define double @test_pow_afn_f64_nnan_ninf__y_4_5(double %x) {
1914; CHECK-LABEL: define double @test_pow_afn_f64_nnan_ninf__y_4_5
1915; CHECK-SAME: (double [[X:%.*]]) {
1916; CHECK-NEXT:    [[POW:%.*]] = tail call nnan ninf afn double @_Z3powdd(double [[X]], double 4.500000e+00)
1917; CHECK-NEXT:    ret double [[POW]]
1918;
1919  %pow = tail call afn nnan ninf double @_Z3powdd(double %x, double 4.5)
1920  ret double %pow
1921}
1922
1923define double @test_pow_afn_f64__y_5(double %x) {
1924; CHECK-LABEL: define double @test_pow_afn_f64__y_5
1925; CHECK-SAME: (double [[X:%.*]]) {
1926; CHECK-NEXT:    [[POW:%.*]] = tail call afn double @_Z4powndi(double [[X]], i32 5)
1927; CHECK-NEXT:    ret double [[POW]]
1928;
1929  %pow = tail call afn double @_Z3powdd(double %x, double 5.0)
1930  ret double %pow
1931}
1932
1933define double @test_pow_afn_f64_nnan_ninf__y_5(double %x) {
1934; CHECK-LABEL: define double @test_pow_afn_f64_nnan_ninf__y_5
1935; CHECK-SAME: (double [[X:%.*]]) {
1936; CHECK-NEXT:    [[__POWX2:%.*]] = fmul nnan ninf afn double [[X]], [[X]]
1937; CHECK-NEXT:    [[__POWX21:%.*]] = fmul nnan ninf afn double [[__POWX2]], [[__POWX2]]
1938; CHECK-NEXT:    [[__POWPROD:%.*]] = fmul nnan ninf afn double [[X]], [[__POWX21]]
1939; CHECK-NEXT:    ret double [[__POWPROD]]
1940;
1941  %pow = tail call afn nnan ninf double @_Z3powdd(double %x, double 5.0)
1942  ret double %pow
1943}
1944
1945define double @test_pow_afn_f64__y_neg5(double %x) {
1946; CHECK-LABEL: define double @test_pow_afn_f64__y_neg5
1947; CHECK-SAME: (double [[X:%.*]]) {
1948; CHECK-NEXT:    [[POW:%.*]] = tail call afn double @_Z4powndi(double [[X]], i32 -5)
1949; CHECK-NEXT:    ret double [[POW]]
1950;
1951  %pow = tail call afn double @_Z3powdd(double %x, double -5.0)
1952  ret double %pow
1953}
1954
1955define double @test_pow_afn_f64_nnan_ninf__y_neg5(double %x) {
1956; CHECK-LABEL: define double @test_pow_afn_f64_nnan_ninf__y_neg5
1957; CHECK-SAME: (double [[X:%.*]]) {
1958; CHECK-NEXT:    [[__POWX2:%.*]] = fmul nnan ninf afn double [[X]], [[X]]
1959; CHECK-NEXT:    [[__POWX21:%.*]] = fmul nnan ninf afn double [[__POWX2]], [[__POWX2]]
1960; CHECK-NEXT:    [[__POWPROD:%.*]] = fmul nnan ninf afn double [[X]], [[__POWX21]]
1961; CHECK-NEXT:    [[__1POWPROD:%.*]] = fdiv nnan ninf afn double 1.000000e+00, [[__POWPROD]]
1962; CHECK-NEXT:    ret double [[__1POWPROD]]
1963;
1964  %pow = tail call afn nnan ninf double @_Z3powdd(double %x, double -5.0)
1965  ret double %pow
1966}
1967
1968define double @test_pow_afn_f64_nnan_ninf__y_10(double %x) {
1969; CHECK-LABEL: define double @test_pow_afn_f64_nnan_ninf__y_10
1970; CHECK-SAME: (double [[X:%.*]]) {
1971; CHECK-NEXT:    [[__POWX2:%.*]] = fmul nnan ninf afn double [[X]], [[X]]
1972; CHECK-NEXT:    [[__POWX21:%.*]] = fmul nnan ninf afn double [[__POWX2]], [[__POWX2]]
1973; CHECK-NEXT:    [[__POWX22:%.*]] = fmul nnan ninf afn double [[__POWX21]], [[__POWX21]]
1974; CHECK-NEXT:    [[__POWPROD:%.*]] = fmul nnan ninf afn double [[__POWX2]], [[__POWX22]]
1975; CHECK-NEXT:    ret double [[__POWPROD]]
1976;
1977  %pow = tail call afn nnan ninf double @_Z3powdd(double %x, double 10.0)
1978  ret double %pow
1979}
1980
1981define <2 x double> @test_pow_afn_v2f64_nnan_ninf__y_3(<2 x double> %x) {
1982; CHECK-LABEL: define <2 x double> @test_pow_afn_v2f64_nnan_ninf__y_3
1983; CHECK-SAME: (<2 x double> [[X:%.*]]) {
1984; CHECK-NEXT:    [[__POWX2:%.*]] = fmul nnan ninf afn <2 x double> [[X]], [[X]]
1985; CHECK-NEXT:    [[__POWPROD:%.*]] = fmul nnan ninf afn <2 x double> [[X]], [[__POWX2]]
1986; CHECK-NEXT:    ret <2 x double> [[__POWPROD]]
1987;
1988  %pow = tail call afn nnan ninf <2 x double> @_Z3powDv2_dS_(<2 x double> %x, <2 x double> <double 3.0, double 3.0>)
1989  ret <2 x double> %pow
1990}
1991
1992define <2 x double> @test_pow_afn_v2f64_nnan_ninf__y_4(<2 x double> %x) {
1993; CHECK-LABEL: define <2 x double> @test_pow_afn_v2f64_nnan_ninf__y_4
1994; CHECK-SAME: (<2 x double> [[X:%.*]]) {
1995; CHECK-NEXT:    [[__POWX2:%.*]] = fmul nnan ninf afn <2 x double> [[X]], [[X]]
1996; CHECK-NEXT:    [[__POWX21:%.*]] = fmul nnan ninf afn <2 x double> [[__POWX2]], [[__POWX2]]
1997; CHECK-NEXT:    ret <2 x double> [[__POWX21]]
1998;
1999  %pow = tail call afn nnan ninf <2 x double> @_Z3powDv2_dS_(<2 x double> %x, <2 x double> <double 4.0, double 4.0>)
2000  ret <2 x double> %pow
2001}
2002
2003define <2 x double> @test_pow_afn_v2f64_nnan_ninf__y_4_5(<2 x double> %x) {
2004; CHECK-LABEL: define <2 x double> @test_pow_afn_v2f64_nnan_ninf__y_4_5
2005; CHECK-SAME: (<2 x double> [[X:%.*]]) {
2006; CHECK-NEXT:    [[POW:%.*]] = tail call nnan ninf afn <2 x double> @_Z3powDv2_dS_(<2 x double> [[X]], <2 x double> splat (double 4.500000e+00))
2007; CHECK-NEXT:    ret <2 x double> [[POW]]
2008;
2009  %pow = tail call afn nnan ninf <2 x double> @_Z3powDv2_dS_(<2 x double> %x, <2 x double> <double 4.5, double 4.5>)
2010  ret <2 x double> %pow
2011}
2012
2013define <2 x double> @test_pow_afn_v2f64_nnan_ninf__y_5(<2 x double> %x) {
2014; CHECK-LABEL: define <2 x double> @test_pow_afn_v2f64_nnan_ninf__y_5
2015; CHECK-SAME: (<2 x double> [[X:%.*]]) {
2016; CHECK-NEXT:    [[__POWX2:%.*]] = fmul nnan ninf afn <2 x double> [[X]], [[X]]
2017; CHECK-NEXT:    [[__POWX21:%.*]] = fmul nnan ninf afn <2 x double> [[__POWX2]], [[__POWX2]]
2018; CHECK-NEXT:    [[__POWPROD:%.*]] = fmul nnan ninf afn <2 x double> [[X]], [[__POWX21]]
2019; CHECK-NEXT:    ret <2 x double> [[__POWPROD]]
2020;
2021  %pow = tail call afn nnan ninf <2 x double> @_Z3powDv2_dS_(<2 x double> %x, <2 x double> <double 5.0, double 5.0>)
2022  ret <2 x double> %pow
2023}
2024
2025define half @test_pow_afn_f16__y_3(half %x) {
2026; CHECK-LABEL: define half @test_pow_afn_f16__y_3
2027; CHECK-SAME: (half [[X:%.*]]) {
2028; CHECK-NEXT:    [[POW:%.*]] = tail call afn half @_Z4pownDhi(half [[X]], i32 3)
2029; CHECK-NEXT:    ret half [[POW]]
2030;
2031  %pow = tail call afn half @_Z3powDhDh(half %x, half 3.0)
2032  ret half %pow
2033}
2034
2035define half @test_pow_afn_f16_nnan_ninf__y_3(half %x) {
2036; CHECK-LABEL: define half @test_pow_afn_f16_nnan_ninf__y_3
2037; CHECK-SAME: (half [[X:%.*]]) {
2038; CHECK-NEXT:    [[__POWX2:%.*]] = fmul nnan ninf afn half [[X]], [[X]]
2039; CHECK-NEXT:    [[__POWPROD:%.*]] = fmul nnan ninf afn half [[X]], [[__POWX2]]
2040; CHECK-NEXT:    ret half [[__POWPROD]]
2041;
2042  %pow = tail call afn nnan ninf half @_Z3powDhDh(half %x, half 3.0)
2043  ret half %pow
2044}
2045
2046define half @test_pow_afn_f16__y_4(half %x) {
2047; CHECK-LABEL: define half @test_pow_afn_f16__y_4
2048; CHECK-SAME: (half [[X:%.*]]) {
2049; CHECK-NEXT:    [[POW:%.*]] = tail call afn half @_Z4pownDhi(half [[X]], i32 4)
2050; CHECK-NEXT:    ret half [[POW]]
2051;
2052  %pow = tail call afn half @_Z3powDhDh(half %x, half 4.0)
2053  ret half %pow
2054}
2055
2056define half @test_pow_afn_f16_nnan_ninf__y_4(half %x) {
2057; CHECK-LABEL: define half @test_pow_afn_f16_nnan_ninf__y_4
2058; CHECK-SAME: (half [[X:%.*]]) {
2059; CHECK-NEXT:    [[__POWX2:%.*]] = fmul nnan ninf afn half [[X]], [[X]]
2060; CHECK-NEXT:    [[__POWX21:%.*]] = fmul nnan ninf afn half [[__POWX2]], [[__POWX2]]
2061; CHECK-NEXT:    ret half [[__POWX21]]
2062;
2063  %pow = tail call afn nnan ninf half @_Z3powDhDh(half %x, half 4.0)
2064  ret half %pow
2065}
2066
2067define half @test_pow_afn_f16_nnan_ninf__y_4_5(half %x) {
2068; CHECK-LABEL: define half @test_pow_afn_f16_nnan_ninf__y_4_5
2069; CHECK-SAME: (half [[X:%.*]]) {
2070; CHECK-NEXT:    [[POW:%.*]] = tail call nnan ninf afn half @_Z3powDhDh(half [[X]], half 0xH4480)
2071; CHECK-NEXT:    ret half [[POW]]
2072;
2073  %pow = tail call afn nnan ninf half @_Z3powDhDh(half %x, half 4.5)
2074  ret half %pow
2075}
2076
2077define half @test_pow_afn_f16__y_5(half %x) {
2078; CHECK-LABEL: define half @test_pow_afn_f16__y_5
2079; CHECK-SAME: (half [[X:%.*]]) {
2080; CHECK-NEXT:    [[POW:%.*]] = tail call afn half @_Z4pownDhi(half [[X]], i32 5)
2081; CHECK-NEXT:    ret half [[POW]]
2082;
2083  %pow = tail call afn half @_Z3powDhDh(half %x, half 5.0)
2084  ret half %pow
2085}
2086
2087define half @test_pow_afn_f16_nnan_ninf__y_5(half %x) {
2088; CHECK-LABEL: define half @test_pow_afn_f16_nnan_ninf__y_5
2089; CHECK-SAME: (half [[X:%.*]]) {
2090; CHECK-NEXT:    [[__POWX2:%.*]] = fmul nnan ninf afn half [[X]], [[X]]
2091; CHECK-NEXT:    [[__POWX21:%.*]] = fmul nnan ninf afn half [[__POWX2]], [[__POWX2]]
2092; CHECK-NEXT:    [[__POWPROD:%.*]] = fmul nnan ninf afn half [[X]], [[__POWX21]]
2093; CHECK-NEXT:    ret half [[__POWPROD]]
2094;
2095  %pow = tail call afn nnan ninf half @_Z3powDhDh(half %x, half 5.0)
2096  ret half %pow
2097}
2098
2099define half @test_pow_afn_f16__y_neg5(half %x) {
2100; CHECK-LABEL: define half @test_pow_afn_f16__y_neg5
2101; CHECK-SAME: (half [[X:%.*]]) {
2102; CHECK-NEXT:    [[POW:%.*]] = tail call afn half @_Z4pownDhi(half [[X]], i32 -5)
2103; CHECK-NEXT:    ret half [[POW]]
2104;
2105  %pow = tail call afn half @_Z3powDhDh(half %x, half -5.0)
2106  ret half %pow
2107}
2108
2109define half @test_pow_afn_f16_nnan_ninf__y_neg5(half %x) {
2110; CHECK-LABEL: define half @test_pow_afn_f16_nnan_ninf__y_neg5
2111; CHECK-SAME: (half [[X:%.*]]) {
2112; CHECK-NEXT:    [[__POWX2:%.*]] = fmul nnan ninf afn half [[X]], [[X]]
2113; CHECK-NEXT:    [[__POWX21:%.*]] = fmul nnan ninf afn half [[__POWX2]], [[__POWX2]]
2114; CHECK-NEXT:    [[__POWPROD:%.*]] = fmul nnan ninf afn half [[X]], [[__POWX21]]
2115; CHECK-NEXT:    [[__1POWPROD:%.*]] = fdiv nnan ninf afn half 0xH3C00, [[__POWPROD]]
2116; CHECK-NEXT:    ret half [[__1POWPROD]]
2117;
2118  %pow = tail call afn nnan ninf half @_Z3powDhDh(half %x, half -5.0)
2119  ret half %pow
2120}
2121
2122define half @test_pow_afn_f16_nnan_ninf__y_10(half %x) {
2123; CHECK-LABEL: define half @test_pow_afn_f16_nnan_ninf__y_10
2124; CHECK-SAME: (half [[X:%.*]]) {
2125; CHECK-NEXT:    [[__POWX2:%.*]] = fmul nnan ninf afn half [[X]], [[X]]
2126; CHECK-NEXT:    [[__POWX21:%.*]] = fmul nnan ninf afn half [[__POWX2]], [[__POWX2]]
2127; CHECK-NEXT:    [[__POWX22:%.*]] = fmul nnan ninf afn half [[__POWX21]], [[__POWX21]]
2128; CHECK-NEXT:    [[__POWPROD:%.*]] = fmul nnan ninf afn half [[__POWX2]], [[__POWX22]]
2129; CHECK-NEXT:    ret half [[__POWPROD]]
2130;
2131  %pow = tail call afn nnan ninf half @_Z3powDhDh(half %x, half 10.0)
2132  ret half %pow
2133}
2134
2135define <2 x half> @test_pow_afn_v2f16_nnan_ninf__y_3(<2 x half> %x) {
2136; CHECK-LABEL: define <2 x half> @test_pow_afn_v2f16_nnan_ninf__y_3
2137; CHECK-SAME: (<2 x half> [[X:%.*]]) {
2138; CHECK-NEXT:    [[__POWX2:%.*]] = fmul nnan ninf afn <2 x half> [[X]], [[X]]
2139; CHECK-NEXT:    [[__POWPROD:%.*]] = fmul nnan ninf afn <2 x half> [[X]], [[__POWX2]]
2140; CHECK-NEXT:    ret <2 x half> [[__POWPROD]]
2141;
2142  %pow = tail call afn nnan ninf <2 x half> @_Z3powDv2_DhS_(<2 x half> %x, <2 x half> <half 3.0, half 3.0>)
2143  ret <2 x half> %pow
2144}
2145
2146define <2 x half> @test_pow_afn_v2f16_nnan_ninf__y_4(<2 x half> %x) {
2147; CHECK-LABEL: define <2 x half> @test_pow_afn_v2f16_nnan_ninf__y_4
2148; CHECK-SAME: (<2 x half> [[X:%.*]]) {
2149; CHECK-NEXT:    [[__POWX2:%.*]] = fmul nnan ninf afn <2 x half> [[X]], [[X]]
2150; CHECK-NEXT:    [[__POWX21:%.*]] = fmul nnan ninf afn <2 x half> [[__POWX2]], [[__POWX2]]
2151; CHECK-NEXT:    ret <2 x half> [[__POWX21]]
2152;
2153  %pow = tail call afn nnan ninf <2 x half> @_Z3powDv2_DhS_(<2 x half> %x, <2 x half> <half 4.0, half 4.0>)
2154  ret <2 x half> %pow
2155}
2156
2157define <2 x half> @test_pow_afn_v2f16_nnan_ninf__y_4_5(<2 x half> %x) {
2158; CHECK-LABEL: define <2 x half> @test_pow_afn_v2f16_nnan_ninf__y_4_5
2159; CHECK-SAME: (<2 x half> [[X:%.*]]) {
2160; CHECK-NEXT:    [[POW:%.*]] = tail call nnan ninf afn <2 x half> @_Z3powDv2_DhS_(<2 x half> [[X]], <2 x half> splat (half 0xH4480))
2161; CHECK-NEXT:    ret <2 x half> [[POW]]
2162;
2163  %pow = tail call afn nnan ninf <2 x half> @_Z3powDv2_DhS_(<2 x half> %x, <2 x half> <half 4.5, half 4.5>)
2164  ret <2 x half> %pow
2165}
2166
2167define <2 x half> @test_pow_afn_v2f16_nnan_ninf__y_5(<2 x half> %x) {
2168; CHECK-LABEL: define <2 x half> @test_pow_afn_v2f16_nnan_ninf__y_5
2169; CHECK-SAME: (<2 x half> [[X:%.*]]) {
2170; CHECK-NEXT:    [[__POWX2:%.*]] = fmul nnan ninf afn <2 x half> [[X]], [[X]]
2171; CHECK-NEXT:    [[__POWX21:%.*]] = fmul nnan ninf afn <2 x half> [[__POWX2]], [[__POWX2]]
2172; CHECK-NEXT:    [[__POWPROD:%.*]] = fmul nnan ninf afn <2 x half> [[X]], [[__POWX21]]
2173; CHECK-NEXT:    ret <2 x half> [[__POWPROD]]
2174;
2175  %pow = tail call afn nnan ninf <2 x half> @_Z3powDv2_DhS_(<2 x half> %x, <2 x half> <half 5.0, half 5.0>)
2176  ret <2 x half> %pow
2177}
2178
2179define float @test_pow_f32_known_integral_sitofp(float %x, i32 %y) {
2180; CHECK-LABEL: define float @test_pow_f32_known_integral_sitofp
2181; CHECK-SAME: (float [[X:%.*]], i32 [[Y:%.*]]) {
2182; CHECK-NEXT:    [[Y_CAST:%.*]] = sitofp i32 [[Y]] to float
2183; CHECK-NEXT:    [[TMP1:%.*]] = fptosi float [[Y_CAST]] to i32
2184; CHECK-NEXT:    [[POW:%.*]] = tail call float @_Z4pownfi(float [[X]], i32 [[TMP1]])
2185; CHECK-NEXT:    ret float [[POW]]
2186;
2187  %y.cast = sitofp i32 %y to float
2188  %pow = tail call float @_Z3powff(float %x, float %y.cast)
2189  ret float %pow
2190}
2191
2192define float @test_pow_afn_f32_known_integral_sitofp(float %x, i32 %y) {
2193; CHECK-LABEL: define float @test_pow_afn_f32_known_integral_sitofp
2194; CHECK-SAME: (float [[X:%.*]], i32 [[Y:%.*]]) {
2195; CHECK-NEXT:    [[Y_CAST:%.*]] = sitofp i32 [[Y]] to float
2196; CHECK-NEXT:    [[TMP1:%.*]] = fptosi float [[Y_CAST]] to i32
2197; CHECK-NEXT:    [[POW:%.*]] = tail call afn float @_Z4pownfi(float [[X]], i32 [[TMP1]])
2198; CHECK-NEXT:    ret float [[POW]]
2199;
2200  %y.cast = sitofp i32 %y to float
2201  %pow = tail call afn float @_Z3powff(float %x, float %y.cast)
2202  ret float %pow
2203}
2204
2205define float @test_pow_afn_nnan_ninf_f32_known_integral_sitofp(float %x, i32 %y) {
2206; CHECK-LABEL: define float @test_pow_afn_nnan_ninf_f32_known_integral_sitofp
2207; CHECK-SAME: (float [[X:%.*]], i32 [[Y:%.*]]) {
2208; CHECK-NEXT:    [[Y_CAST:%.*]] = sitofp i32 [[Y]] to float
2209; CHECK-NEXT:    [[TMP1:%.*]] = fptosi float [[Y_CAST]] to i32
2210; CHECK-NEXT:    [[__FABS:%.*]] = call nnan ninf afn float @llvm.fabs.f32(float [[X]])
2211; CHECK-NEXT:    [[__LOG2:%.*]] = call nnan ninf afn float @llvm.log2.f32(float [[__FABS]])
2212; CHECK-NEXT:    [[POWNI2F:%.*]] = sitofp i32 [[TMP1]] to float
2213; CHECK-NEXT:    [[__YLOGX:%.*]] = fmul nnan ninf afn float [[__LOG2]], [[POWNI2F]]
2214; CHECK-NEXT:    [[__EXP2:%.*]] = call nnan ninf afn float @llvm.exp2.f32(float [[__YLOGX]])
2215; CHECK-NEXT:    [[__YEVEN:%.*]] = shl i32 [[TMP1]], 31
2216; CHECK-NEXT:    [[TMP2:%.*]] = bitcast float [[X]] to i32
2217; CHECK-NEXT:    [[__POW_SIGN:%.*]] = and i32 [[__YEVEN]], [[TMP2]]
2218; CHECK-NEXT:    [[TMP3:%.*]] = bitcast float [[__EXP2]] to i32
2219; CHECK-NEXT:    [[TMP4:%.*]] = or disjoint i32 [[__POW_SIGN]], [[TMP3]]
2220; CHECK-NEXT:    [[TMP5:%.*]] = bitcast i32 [[TMP4]] to float
2221; CHECK-NEXT:    ret float [[TMP5]]
2222;
2223  %y.cast = sitofp i32 %y to float
2224  %pow = tail call afn nnan ninf float @_Z3powff(float %x, float %y.cast)
2225  ret float %pow
2226}
2227
2228define float @test_pow_afn_nnan_f32_known_integral_sitofp(float %x, i32 %y) {
2229; CHECK-LABEL: define float @test_pow_afn_nnan_f32_known_integral_sitofp
2230; CHECK-SAME: (float [[X:%.*]], i32 [[Y:%.*]]) {
2231; CHECK-NEXT:    [[Y_CAST:%.*]] = sitofp i32 [[Y]] to float
2232; CHECK-NEXT:    [[TMP1:%.*]] = fptosi float [[Y_CAST]] to i32
2233; CHECK-NEXT:    [[POW:%.*]] = tail call nnan afn float @_Z4pownfi(float [[X]], i32 [[TMP1]])
2234; CHECK-NEXT:    ret float [[POW]]
2235;
2236  %y.cast = sitofp i32 %y to float
2237  %pow = tail call afn nnan float @_Z3powff(float %x, float %y.cast)
2238  ret float %pow
2239}
2240
2241define float @test_pow_afn_ninf_f32_known_integral_sitofp(float %x, i32 %y) {
2242; CHECK-LABEL: define float @test_pow_afn_ninf_f32_known_integral_sitofp
2243; CHECK-SAME: (float [[X:%.*]], i32 [[Y:%.*]]) {
2244; CHECK-NEXT:    [[Y_CAST:%.*]] = sitofp i32 [[Y]] to float
2245; CHECK-NEXT:    [[TMP1:%.*]] = fptosi float [[Y_CAST]] to i32
2246; CHECK-NEXT:    [[POW:%.*]] = tail call ninf afn float @_Z4pownfi(float [[X]], i32 [[TMP1]])
2247; CHECK-NEXT:    ret float [[POW]]
2248;
2249  %y.cast = sitofp i32 %y to float
2250  %pow = tail call afn ninf float @_Z3powff(float %x, float %y.cast)
2251  ret float %pow
2252}
2253
2254define float @test_pow_afn_f32_known_integral_sitofp_finite_argument(float %x, i32 %y) {
2255; CHECK-LABEL: define float @test_pow_afn_f32_known_integral_sitofp_finite_argument
2256; CHECK-SAME: (float [[X:%.*]], i32 [[Y:%.*]]) {
2257; CHECK-NEXT:    [[Y_CAST:%.*]] = sitofp i32 [[Y]] to float
2258; CHECK-NEXT:    [[TMP1:%.*]] = fptosi float [[Y_CAST]] to i32
2259; CHECK-NEXT:    [[POW:%.*]] = tail call float @_Z4pownfi(float [[X]], i32 [[TMP1]])
2260; CHECK-NEXT:    ret float [[POW]]
2261;
2262  %y.cast = sitofp i32 %y to float
2263  %pow = tail call float @_Z3powff(float %x, float nofpclass(inf nan) %y.cast)
2264  ret float %pow
2265}
2266
2267define float @test_pow_f32_known_integral_uitofp(float %x, i32 %y) {
2268; CHECK-LABEL: define float @test_pow_f32_known_integral_uitofp
2269; CHECK-SAME: (float [[X:%.*]], i32 [[Y:%.*]]) {
2270; CHECK-NEXT:    [[Y_CAST:%.*]] = uitofp i32 [[Y]] to float
2271; CHECK-NEXT:    [[TMP1:%.*]] = fptosi float [[Y_CAST]] to i32
2272; CHECK-NEXT:    [[POW:%.*]] = tail call float @_Z4pownfi(float [[X]], i32 [[TMP1]])
2273; CHECK-NEXT:    ret float [[POW]]
2274;
2275  %y.cast = uitofp i32 %y to float
2276  %pow = tail call float @_Z3powff(float %x, float %y.cast)
2277  ret float %pow
2278}
2279
2280define float @test_pow_afn_f32_known_integral_uitofp(float %x, i32 %y) {
2281; CHECK-LABEL: define float @test_pow_afn_f32_known_integral_uitofp
2282; CHECK-SAME: (float [[X:%.*]], i32 [[Y:%.*]]) {
2283; CHECK-NEXT:    [[Y_CAST:%.*]] = uitofp i32 [[Y]] to float
2284; CHECK-NEXT:    [[TMP1:%.*]] = fptosi float [[Y_CAST]] to i32
2285; CHECK-NEXT:    [[POW:%.*]] = tail call afn float @_Z4pownfi(float [[X]], i32 [[TMP1]])
2286; CHECK-NEXT:    ret float [[POW]]
2287;
2288  %y.cast = uitofp i32 %y to float
2289  %pow = tail call afn float @_Z3powff(float %x, float %y.cast)
2290  ret float %pow
2291}
2292
2293define float @test_pow_afn_nnan_ninf_f32_known_integral_uitofp(float %x, i32 %y) {
2294; CHECK-LABEL: define float @test_pow_afn_nnan_ninf_f32_known_integral_uitofp
2295; CHECK-SAME: (float [[X:%.*]], i32 [[Y:%.*]]) {
2296; CHECK-NEXT:    [[Y_CAST:%.*]] = uitofp i32 [[Y]] to float
2297; CHECK-NEXT:    [[TMP1:%.*]] = fptosi float [[Y_CAST]] to i32
2298; CHECK-NEXT:    [[__FABS:%.*]] = call nnan ninf afn float @llvm.fabs.f32(float [[X]])
2299; CHECK-NEXT:    [[__LOG2:%.*]] = call nnan ninf afn float @llvm.log2.f32(float [[__FABS]])
2300; CHECK-NEXT:    [[POWNI2F:%.*]] = sitofp i32 [[TMP1]] to float
2301; CHECK-NEXT:    [[__YLOGX:%.*]] = fmul nnan ninf afn float [[__LOG2]], [[POWNI2F]]
2302; CHECK-NEXT:    [[__EXP2:%.*]] = call nnan ninf afn float @llvm.exp2.f32(float [[__YLOGX]])
2303; CHECK-NEXT:    [[__YEVEN:%.*]] = shl i32 [[TMP1]], 31
2304; CHECK-NEXT:    [[TMP2:%.*]] = bitcast float [[X]] to i32
2305; CHECK-NEXT:    [[__POW_SIGN:%.*]] = and i32 [[__YEVEN]], [[TMP2]]
2306; CHECK-NEXT:    [[TMP3:%.*]] = bitcast float [[__EXP2]] to i32
2307; CHECK-NEXT:    [[TMP4:%.*]] = or disjoint i32 [[__POW_SIGN]], [[TMP3]]
2308; CHECK-NEXT:    [[TMP5:%.*]] = bitcast i32 [[TMP4]] to float
2309; CHECK-NEXT:    ret float [[TMP5]]
2310;
2311  %y.cast = uitofp i32 %y to float
2312  %pow = tail call afn nnan ninf float @_Z3powff(float %x, float %y.cast)
2313  ret float %pow
2314}
2315
2316; cast from i256 may produce infinity so can't assume integer without ninf
2317define float @test_pow_afn_nnan_f32_known_integral_uitofp_i256(float %x, i256 %y) {
2318; CHECK-LABEL: define float @test_pow_afn_nnan_f32_known_integral_uitofp_i256
2319; CHECK-SAME: (float [[X:%.*]], i256 [[Y:%.*]]) {
2320; CHECK-NEXT:    [[Y_CAST:%.*]] = uitofp i256 [[Y]] to float
2321; CHECK-NEXT:    [[POW:%.*]] = tail call nnan afn float @_Z3powff(float [[X]], float [[Y_CAST]])
2322; CHECK-NEXT:    ret float [[POW]]
2323;
2324  %y.cast = uitofp i256 %y to float
2325  %pow = tail call afn nnan float @_Z3powff(float %x, float %y.cast)
2326  ret float %pow
2327}
2328
2329; cast from i256 may produce infinity so can't assume integer without ninf
2330define float @test_pow_afn_nnan_f32_known_integral_sitofp_i256(float %x, i256 %y) {
2331; CHECK-LABEL: define float @test_pow_afn_nnan_f32_known_integral_sitofp_i256
2332; CHECK-SAME: (float [[X:%.*]], i256 [[Y:%.*]]) {
2333; CHECK-NEXT:    [[Y_CAST:%.*]] = sitofp i256 [[Y]] to float
2334; CHECK-NEXT:    [[POW:%.*]] = tail call nnan afn float @_Z3powff(float [[X]], float [[Y_CAST]])
2335; CHECK-NEXT:    ret float [[POW]]
2336;
2337  %y.cast = sitofp i256 %y to float
2338  %pow = tail call afn nnan float @_Z3powff(float %x, float %y.cast)
2339  ret float %pow
2340}
2341
2342define float @test_pow_afn_nnan_ninf_f32_known_integral_uitofp_i256(float %x, i256 %y) {
2343; CHECK-LABEL: define float @test_pow_afn_nnan_ninf_f32_known_integral_uitofp_i256
2344; CHECK-SAME: (float [[X:%.*]], i256 [[Y:%.*]]) {
2345; CHECK-NEXT:    [[Y_CAST:%.*]] = uitofp i256 [[Y]] to float
2346; CHECK-NEXT:    [[TMP1:%.*]] = fptosi float [[Y_CAST]] to i32
2347; CHECK-NEXT:    [[__FABS:%.*]] = call nnan ninf afn float @llvm.fabs.f32(float [[X]])
2348; CHECK-NEXT:    [[__LOG2:%.*]] = call nnan ninf afn float @llvm.log2.f32(float [[__FABS]])
2349; CHECK-NEXT:    [[POWNI2F:%.*]] = sitofp i32 [[TMP1]] to float
2350; CHECK-NEXT:    [[__YLOGX:%.*]] = fmul nnan ninf afn float [[__LOG2]], [[POWNI2F]]
2351; CHECK-NEXT:    [[__EXP2:%.*]] = call nnan ninf afn float @llvm.exp2.f32(float [[__YLOGX]])
2352; CHECK-NEXT:    [[__YEVEN:%.*]] = shl i32 [[TMP1]], 31
2353; CHECK-NEXT:    [[TMP2:%.*]] = bitcast float [[X]] to i32
2354; CHECK-NEXT:    [[__POW_SIGN:%.*]] = and i32 [[__YEVEN]], [[TMP2]]
2355; CHECK-NEXT:    [[TMP3:%.*]] = bitcast float [[__EXP2]] to i32
2356; CHECK-NEXT:    [[TMP4:%.*]] = or disjoint i32 [[__POW_SIGN]], [[TMP3]]
2357; CHECK-NEXT:    [[TMP5:%.*]] = bitcast i32 [[TMP4]] to float
2358; CHECK-NEXT:    ret float [[TMP5]]
2359;
2360  %y.cast = uitofp i256 %y to float
2361  %pow = tail call afn nnan ninf float @_Z3powff(float %x, float %y.cast)
2362  ret float %pow
2363}
2364
2365define float @test_pow_afn_nnan_ninf_f32_known_integral_sitofp_i256(float %x, i256 %y) {
2366; CHECK-LABEL: define float @test_pow_afn_nnan_ninf_f32_known_integral_sitofp_i256
2367; CHECK-SAME: (float [[X:%.*]], i256 [[Y:%.*]]) {
2368; CHECK-NEXT:    [[Y_CAST:%.*]] = sitofp i256 [[Y]] to float
2369; CHECK-NEXT:    [[TMP1:%.*]] = fptosi float [[Y_CAST]] to i32
2370; CHECK-NEXT:    [[__FABS:%.*]] = call nnan ninf afn float @llvm.fabs.f32(float [[X]])
2371; CHECK-NEXT:    [[__LOG2:%.*]] = call nnan ninf afn float @llvm.log2.f32(float [[__FABS]])
2372; CHECK-NEXT:    [[POWNI2F:%.*]] = sitofp i32 [[TMP1]] to float
2373; CHECK-NEXT:    [[__YLOGX:%.*]] = fmul nnan ninf afn float [[__LOG2]], [[POWNI2F]]
2374; CHECK-NEXT:    [[__EXP2:%.*]] = call nnan ninf afn float @llvm.exp2.f32(float [[__YLOGX]])
2375; CHECK-NEXT:    [[__YEVEN:%.*]] = shl i32 [[TMP1]], 31
2376; CHECK-NEXT:    [[TMP2:%.*]] = bitcast float [[X]] to i32
2377; CHECK-NEXT:    [[__POW_SIGN:%.*]] = and i32 [[__YEVEN]], [[TMP2]]
2378; CHECK-NEXT:    [[TMP3:%.*]] = bitcast float [[__EXP2]] to i32
2379; CHECK-NEXT:    [[TMP4:%.*]] = or disjoint i32 [[__POW_SIGN]], [[TMP3]]
2380; CHECK-NEXT:    [[TMP5:%.*]] = bitcast i32 [[TMP4]] to float
2381; CHECK-NEXT:    ret float [[TMP5]]
2382;
2383  %y.cast = sitofp i256 %y to float
2384  %pow = tail call afn nnan ninf float @_Z3powff(float %x, float %y.cast)
2385  ret float %pow
2386}
2387
2388define <2 x float> @test_pow_afn_nnan_ninf_v2f32_known_integral_sitofp(<2 x float> %x, <2 x i32> %y) {
2389; CHECK-LABEL: define <2 x float> @test_pow_afn_nnan_ninf_v2f32_known_integral_sitofp
2390; CHECK-SAME: (<2 x float> [[X:%.*]], <2 x i32> [[Y:%.*]]) {
2391; CHECK-NEXT:    [[Y_CAST:%.*]] = sitofp <2 x i32> [[Y]] to <2 x float>
2392; CHECK-NEXT:    [[TMP1:%.*]] = fptosi <2 x float> [[Y_CAST]] to <2 x i32>
2393; CHECK-NEXT:    [[__FABS:%.*]] = call nnan ninf afn <2 x float> @llvm.fabs.v2f32(<2 x float> [[X]])
2394; CHECK-NEXT:    [[__LOG2:%.*]] = call nnan ninf afn <2 x float> @llvm.log2.v2f32(<2 x float> [[__FABS]])
2395; CHECK-NEXT:    [[POWNI2F:%.*]] = sitofp <2 x i32> [[TMP1]] to <2 x float>
2396; CHECK-NEXT:    [[__YLOGX:%.*]] = fmul nnan ninf afn <2 x float> [[__LOG2]], [[POWNI2F]]
2397; CHECK-NEXT:    [[__EXP2:%.*]] = call nnan ninf afn <2 x float> @llvm.exp2.v2f32(<2 x float> [[__YLOGX]])
2398; CHECK-NEXT:    [[__YEVEN:%.*]] = shl <2 x i32> [[TMP1]], splat (i32 31)
2399; CHECK-NEXT:    [[TMP2:%.*]] = bitcast <2 x float> [[X]] to <2 x i32>
2400; CHECK-NEXT:    [[__POW_SIGN:%.*]] = and <2 x i32> [[__YEVEN]], [[TMP2]]
2401; CHECK-NEXT:    [[TMP3:%.*]] = bitcast <2 x float> [[__EXP2]] to <2 x i32>
2402; CHECK-NEXT:    [[TMP4:%.*]] = or disjoint <2 x i32> [[__POW_SIGN]], [[TMP3]]
2403; CHECK-NEXT:    [[TMP5:%.*]] = bitcast <2 x i32> [[TMP4]] to <2 x float>
2404; CHECK-NEXT:    ret <2 x float> [[TMP5]]
2405;
2406  %y.cast = sitofp <2 x i32> %y to <2 x float>
2407  %pow = tail call afn nnan ninf <2 x float> @_Z3powDv2_fS_(<2 x float> %x, <2 x float> %y.cast)
2408  ret <2 x float> %pow
2409}
2410
2411define <2 x float> @test_pow_v2f32_known_integral_uitofp(<2 x float> %x, <2 x i32> %y) {
2412; CHECK-LABEL: define <2 x float> @test_pow_v2f32_known_integral_uitofp
2413; CHECK-SAME: (<2 x float> [[X:%.*]], <2 x i32> [[Y:%.*]]) {
2414; CHECK-NEXT:    [[Y_CAST:%.*]] = uitofp <2 x i32> [[Y]] to <2 x float>
2415; CHECK-NEXT:    [[TMP1:%.*]] = fptosi <2 x float> [[Y_CAST]] to <2 x i32>
2416; CHECK-NEXT:    [[POW:%.*]] = tail call <2 x float> @_Z4pownDv2_fDv2_i(<2 x float> [[X]], <2 x i32> [[TMP1]])
2417; CHECK-NEXT:    ret <2 x float> [[POW]]
2418;
2419  %y.cast = uitofp <2 x i32> %y to <2 x float>
2420  %pow = tail call <2 x float> @_Z3powDv2_fS_(<2 x float> %x, <2 x float> %y.cast)
2421  ret <2 x float> %pow
2422}
2423
2424define <2 x float> @test_pow_afn_v2f32_known_integral_uitofp(<2 x float> %x, <2 x i32> %y) {
2425; CHECK-LABEL: define <2 x float> @test_pow_afn_v2f32_known_integral_uitofp
2426; CHECK-SAME: (<2 x float> [[X:%.*]], <2 x i32> [[Y:%.*]]) {
2427; CHECK-NEXT:    [[Y_CAST:%.*]] = uitofp <2 x i32> [[Y]] to <2 x float>
2428; CHECK-NEXT:    [[TMP1:%.*]] = fptosi <2 x float> [[Y_CAST]] to <2 x i32>
2429; CHECK-NEXT:    [[POW:%.*]] = tail call afn <2 x float> @_Z4pownDv2_fDv2_i(<2 x float> [[X]], <2 x i32> [[TMP1]])
2430; CHECK-NEXT:    ret <2 x float> [[POW]]
2431;
2432  %y.cast = uitofp <2 x i32> %y to <2 x float>
2433  %pow = tail call afn <2 x float> @_Z3powDv2_fS_(<2 x float> %x, <2 x float> %y.cast)
2434  ret <2 x float> %pow
2435}
2436
2437define <2 x float> @test_pow_afn_nnan_ninf_v2f32_known_integral_uitofp(<2 x float> %x, <2 x i32> %y) {
2438; CHECK-LABEL: define <2 x float> @test_pow_afn_nnan_ninf_v2f32_known_integral_uitofp
2439; CHECK-SAME: (<2 x float> [[X:%.*]], <2 x i32> [[Y:%.*]]) {
2440; CHECK-NEXT:    [[Y_CAST:%.*]] = uitofp <2 x i32> [[Y]] to <2 x float>
2441; CHECK-NEXT:    [[TMP1:%.*]] = fptosi <2 x float> [[Y_CAST]] to <2 x i32>
2442; CHECK-NEXT:    [[__FABS:%.*]] = call nnan ninf afn <2 x float> @llvm.fabs.v2f32(<2 x float> [[X]])
2443; CHECK-NEXT:    [[__LOG2:%.*]] = call nnan ninf afn <2 x float> @llvm.log2.v2f32(<2 x float> [[__FABS]])
2444; CHECK-NEXT:    [[POWNI2F:%.*]] = sitofp <2 x i32> [[TMP1]] to <2 x float>
2445; CHECK-NEXT:    [[__YLOGX:%.*]] = fmul nnan ninf afn <2 x float> [[__LOG2]], [[POWNI2F]]
2446; CHECK-NEXT:    [[__EXP2:%.*]] = call nnan ninf afn <2 x float> @llvm.exp2.v2f32(<2 x float> [[__YLOGX]])
2447; CHECK-NEXT:    [[__YEVEN:%.*]] = shl <2 x i32> [[TMP1]], splat (i32 31)
2448; CHECK-NEXT:    [[TMP2:%.*]] = bitcast <2 x float> [[X]] to <2 x i32>
2449; CHECK-NEXT:    [[__POW_SIGN:%.*]] = and <2 x i32> [[__YEVEN]], [[TMP2]]
2450; CHECK-NEXT:    [[TMP3:%.*]] = bitcast <2 x float> [[__EXP2]] to <2 x i32>
2451; CHECK-NEXT:    [[TMP4:%.*]] = or disjoint <2 x i32> [[__POW_SIGN]], [[TMP3]]
2452; CHECK-NEXT:    [[TMP5:%.*]] = bitcast <2 x i32> [[TMP4]] to <2 x float>
2453; CHECK-NEXT:    ret <2 x float> [[TMP5]]
2454;
2455  %y.cast = uitofp <2 x i32> %y to <2 x float>
2456  %pow = tail call afn nnan ninf <2 x float> @_Z3powDv2_fS_(<2 x float> %x, <2 x float> %y.cast)
2457  ret <2 x float> %pow
2458}
2459
2460; Could fold to powr or pown
2461define float @test_pow_f32_known_positive_x__known_integral_sitofp(float nofpclass(ninf nsub nnorm) %x, i32 %y) {
2462; CHECK-LABEL: define float @test_pow_f32_known_positive_x__known_integral_sitofp
2463; CHECK-SAME: (float nofpclass(ninf nsub nnorm) [[X:%.*]], i32 [[Y:%.*]]) {
2464; CHECK-NEXT:    [[Y_CAST:%.*]] = sitofp i32 [[Y]] to float
2465; CHECK-NEXT:    [[POW:%.*]] = tail call float @_Z4powrff(float [[X]], float [[Y_CAST]])
2466; CHECK-NEXT:    ret float [[POW]]
2467;
2468  %y.cast = sitofp i32 %y to float
2469  %pow = tail call float @_Z3powff(float %x, float %y.cast)
2470  ret float %pow
2471}
2472
2473define float @test_pow_afn_f32_known_positive_x__known_integral_sitofp(float nofpclass(ninf nsub nnorm) %x, i32 %y) {
2474; CHECK-LABEL: define float @test_pow_afn_f32_known_positive_x__known_integral_sitofp
2475; CHECK-SAME: (float nofpclass(ninf nsub nnorm) [[X:%.*]], i32 [[Y:%.*]]) {
2476; CHECK-NEXT:    [[Y_CAST:%.*]] = sitofp i32 [[Y]] to float
2477; CHECK-NEXT:    [[POW:%.*]] = tail call afn float @_Z4powrff(float [[X]], float [[Y_CAST]])
2478; CHECK-NEXT:    ret float [[POW]]
2479;
2480  %y.cast = sitofp i32 %y to float
2481  %pow = tail call afn float @_Z3powff(float %x, float %y.cast)
2482  ret float %pow
2483}
2484
2485define float @test_pow_afn_nnan_ninf_f32__known_positive_x__known_integral_sitofp(float nofpclass(ninf nsub nnorm) %x, i32 %y) {
2486; CHECK-LABEL: define float @test_pow_afn_nnan_ninf_f32__known_positive_x__known_integral_sitofp
2487; CHECK-SAME: (float nofpclass(ninf nsub nnorm) [[X:%.*]], i32 [[Y:%.*]]) {
2488; CHECK-NEXT:    [[Y_CAST:%.*]] = sitofp i32 [[Y]] to float
2489; CHECK-NEXT:    [[__LOG2:%.*]] = call nnan ninf afn float @llvm.log2.f32(float [[X]])
2490; CHECK-NEXT:    [[__YLOGX:%.*]] = fmul nnan ninf afn float [[__LOG2]], [[Y_CAST]]
2491; CHECK-NEXT:    [[__EXP2:%.*]] = call nnan ninf afn float @llvm.exp2.f32(float [[__YLOGX]])
2492; CHECK-NEXT:    ret float [[__EXP2]]
2493;
2494  %y.cast = sitofp i32 %y to float
2495  %pow = tail call afn nnan ninf float @_Z3powff(float %x, float %y.cast)
2496  ret float %pow
2497}
2498
2499define float @test_pow_f32__y_known_integral_trunc_maybe_inf(float %x, float nofpclass(nan) %y.arg) {
2500; CHECK-LABEL: define float @test_pow_f32__y_known_integral_trunc_maybe_inf
2501; CHECK-SAME: (float [[X:%.*]], float nofpclass(nan) [[Y_ARG:%.*]]) {
2502; CHECK-NEXT:    [[Y:%.*]] = call float @llvm.trunc.f32(float [[Y_ARG]])
2503; CHECK-NEXT:    [[POW:%.*]] = tail call float @_Z3powff(float [[X]], float [[Y]])
2504; CHECK-NEXT:    ret float [[POW]]
2505;
2506  %y = call float @llvm.trunc.f32(float %y.arg)
2507  %pow = tail call float @_Z3powff(float %x, float %y)
2508  ret float %pow
2509}
2510
2511define float @test_pow_f32__y_known_integral_trunc_maybe_nan(float %x, float nofpclass(inf) %y.arg) {
2512; CHECK-LABEL: define float @test_pow_f32__y_known_integral_trunc_maybe_nan
2513; CHECK-SAME: (float [[X:%.*]], float nofpclass(inf) [[Y_ARG:%.*]]) {
2514; CHECK-NEXT:    [[Y:%.*]] = call float @llvm.trunc.f32(float [[Y_ARG]])
2515; CHECK-NEXT:    [[POW:%.*]] = tail call float @_Z3powff(float [[X]], float [[Y]])
2516; CHECK-NEXT:    ret float [[POW]]
2517;
2518  %y = call float @llvm.trunc.f32(float %y.arg)
2519  %pow = tail call float @_Z3powff(float %x, float %y)
2520  ret float %pow
2521}
2522
2523; Cannot fold to pown, may still be inf
2524define float @test_pow_f32__y_known_integral_trunc_nnan_use(float %x, float %y.arg) {
2525; CHECK-LABEL: define float @test_pow_f32__y_known_integral_trunc_nnan_use
2526; CHECK-SAME: (float [[X:%.*]], float [[Y_ARG:%.*]]) {
2527; CHECK-NEXT:    [[Y:%.*]] = call float @llvm.trunc.f32(float [[Y_ARG]])
2528; CHECK-NEXT:    [[POW:%.*]] = tail call nnan float @_Z3powff(float [[X]], float [[Y]])
2529; CHECK-NEXT:    ret float [[POW]]
2530;
2531  %y = call float @llvm.trunc.f32(float %y.arg)
2532  %pow = tail call nnan float @_Z3powff(float %x, float %y)
2533  ret float %pow
2534}
2535
2536; Cannot fold to pown, may still be nan
2537define float @test_pow_f32__y_known_integral_trunc_ninf_use(float %x, float %y.arg) {
2538; CHECK-LABEL: define float @test_pow_f32__y_known_integral_trunc_ninf_use
2539; CHECK-SAME: (float [[X:%.*]], float [[Y_ARG:%.*]]) {
2540; CHECK-NEXT:    [[Y:%.*]] = call float @llvm.trunc.f32(float [[Y_ARG]])
2541; CHECK-NEXT:    [[POW:%.*]] = tail call ninf float @_Z3powff(float [[X]], float [[Y]])
2542; CHECK-NEXT:    ret float [[POW]]
2543;
2544  %y = call float @llvm.trunc.f32(float %y.arg)
2545  %pow = tail call ninf float @_Z3powff(float %x, float %y)
2546  ret float %pow
2547}
2548
2549define float @test_pow_afn_f32_nnan_ninf__y_known_integral_trunc(float %x, float %y.arg) {
2550; CHECK-LABEL: define float @test_pow_afn_f32_nnan_ninf__y_known_integral_trunc
2551; CHECK-SAME: (float [[X:%.*]], float [[Y_ARG:%.*]]) {
2552; CHECK-NEXT:    [[Y:%.*]] = call float @llvm.trunc.f32(float [[Y_ARG]])
2553; CHECK-NEXT:    [[TMP1:%.*]] = fptosi float [[Y]] to i32
2554; CHECK-NEXT:    [[__FABS:%.*]] = call nnan ninf afn float @llvm.fabs.f32(float [[X]])
2555; CHECK-NEXT:    [[__LOG2:%.*]] = call nnan ninf afn float @llvm.log2.f32(float [[__FABS]])
2556; CHECK-NEXT:    [[POWNI2F:%.*]] = sitofp i32 [[TMP1]] to float
2557; CHECK-NEXT:    [[__YLOGX:%.*]] = fmul nnan ninf afn float [[__LOG2]], [[POWNI2F]]
2558; CHECK-NEXT:    [[__EXP2:%.*]] = call nnan ninf afn float @llvm.exp2.f32(float [[__YLOGX]])
2559; CHECK-NEXT:    [[__YEVEN:%.*]] = shl i32 [[TMP1]], 31
2560; CHECK-NEXT:    [[TMP2:%.*]] = bitcast float [[X]] to i32
2561; CHECK-NEXT:    [[__POW_SIGN:%.*]] = and i32 [[__YEVEN]], [[TMP2]]
2562; CHECK-NEXT:    [[TMP3:%.*]] = bitcast float [[__EXP2]] to i32
2563; CHECK-NEXT:    [[TMP4:%.*]] = or disjoint i32 [[__POW_SIGN]], [[TMP3]]
2564; CHECK-NEXT:    [[TMP5:%.*]] = bitcast i32 [[TMP4]] to float
2565; CHECK-NEXT:    ret float [[TMP5]]
2566;
2567  %y = call float @llvm.trunc.f32(float %y.arg)
2568  %pow = tail call afn nnan ninf float @_Z3powff(float %x, float %y)
2569  ret float %pow
2570}
2571
2572define float @test_pow_afn_f32__y_known_integral_trunc(float %x, float nofpclass(inf nan) %y.arg) {
2573; CHECK-LABEL: define float @test_pow_afn_f32__y_known_integral_trunc
2574; CHECK-SAME: (float [[X:%.*]], float nofpclass(nan inf) [[Y_ARG:%.*]]) {
2575; CHECK-NEXT:    [[Y:%.*]] = call float @llvm.trunc.f32(float [[Y_ARG]])
2576; CHECK-NEXT:    [[TMP1:%.*]] = fptosi float [[Y]] to i32
2577; CHECK-NEXT:    [[POW:%.*]] = tail call afn float @_Z4pownfi(float [[X]], i32 [[TMP1]])
2578; CHECK-NEXT:    ret float [[POW]]
2579;
2580  %y = call float @llvm.trunc.f32(float %y.arg)
2581  %pow = tail call afn float @_Z3powff(float %x, float %y)
2582  ret float %pow
2583}
2584
2585define float @test_pow_f32__y_known_integral_floor(float %x, float nofpclass(inf nan) %y.arg) {
2586; CHECK-LABEL: define float @test_pow_f32__y_known_integral_floor
2587; CHECK-SAME: (float [[X:%.*]], float nofpclass(nan inf) [[Y_ARG:%.*]]) {
2588; CHECK-NEXT:    [[Y:%.*]] = call float @llvm.floor.f32(float [[Y_ARG]])
2589; CHECK-NEXT:    [[TMP1:%.*]] = fptosi float [[Y]] to i32
2590; CHECK-NEXT:    [[POW:%.*]] = tail call float @_Z4pownfi(float [[X]], i32 [[TMP1]])
2591; CHECK-NEXT:    ret float [[POW]]
2592;
2593  %y = call float @llvm.floor.f32(float %y.arg)
2594  %pow = tail call float @_Z3powff(float %x, float %y)
2595  ret float %pow
2596}
2597
2598define float @test_pow_f32__y_known_integral_ceil(float %x, float nofpclass(inf nan) %y.arg) {
2599; CHECK-LABEL: define float @test_pow_f32__y_known_integral_ceil
2600; CHECK-SAME: (float [[X:%.*]], float nofpclass(nan inf) [[Y_ARG:%.*]]) {
2601; CHECK-NEXT:    [[Y:%.*]] = call float @llvm.floor.f32(float [[Y_ARG]])
2602; CHECK-NEXT:    [[TMP1:%.*]] = fptosi float [[Y]] to i32
2603; CHECK-NEXT:    [[POW:%.*]] = tail call float @_Z4pownfi(float [[X]], i32 [[TMP1]])
2604; CHECK-NEXT:    ret float [[POW]]
2605;
2606  %y = call float @llvm.floor.f32(float %y.arg)
2607  %pow = tail call float @_Z3powff(float %x, float %y)
2608  ret float %pow
2609}
2610
2611define float @test_pow_f32__y_known_integral_trunc(float %x, float nofpclass(inf nan) %y.arg) {
2612; CHECK-LABEL: define float @test_pow_f32__y_known_integral_trunc
2613; CHECK-SAME: (float [[X:%.*]], float nofpclass(nan inf) [[Y_ARG:%.*]]) {
2614; CHECK-NEXT:    [[Y:%.*]] = call float @llvm.trunc.f32(float [[Y_ARG]])
2615; CHECK-NEXT:    [[TMP1:%.*]] = fptosi float [[Y]] to i32
2616; CHECK-NEXT:    [[POW:%.*]] = tail call float @_Z4pownfi(float [[X]], i32 [[TMP1]])
2617; CHECK-NEXT:    ret float [[POW]]
2618;
2619  %y = call float @llvm.trunc.f32(float %y.arg)
2620  %pow = tail call float @_Z3powff(float %x, float %y)
2621  ret float %pow
2622}
2623
2624define float @test_pow_f32__y_known_integral_rint(float %x, float nofpclass(inf nan) %y.arg) {
2625; CHECK-LABEL: define float @test_pow_f32__y_known_integral_rint
2626; CHECK-SAME: (float [[X:%.*]], float nofpclass(nan inf) [[Y_ARG:%.*]]) {
2627; CHECK-NEXT:    [[Y:%.*]] = call float @llvm.rint.f32(float [[Y_ARG]])
2628; CHECK-NEXT:    [[TMP1:%.*]] = fptosi float [[Y]] to i32
2629; CHECK-NEXT:    [[POW:%.*]] = tail call float @_Z4pownfi(float [[X]], i32 [[TMP1]])
2630; CHECK-NEXT:    ret float [[POW]]
2631;
2632  %y = call float @llvm.rint.f32(float %y.arg)
2633  %pow = tail call float @_Z3powff(float %x, float %y)
2634  ret float %pow
2635}
2636
2637define float @test_pow_f32__y_known_integral_nearbyint(float %x, float nofpclass(inf nan) %y.arg) {
2638; CHECK-LABEL: define float @test_pow_f32__y_known_integral_nearbyint
2639; CHECK-SAME: (float [[X:%.*]], float nofpclass(nan inf) [[Y_ARG:%.*]]) {
2640; CHECK-NEXT:    [[Y:%.*]] = call float @llvm.nearbyint.f32(float [[Y_ARG]])
2641; CHECK-NEXT:    [[TMP1:%.*]] = fptosi float [[Y]] to i32
2642; CHECK-NEXT:    [[POW:%.*]] = tail call float @_Z4pownfi(float [[X]], i32 [[TMP1]])
2643; CHECK-NEXT:    ret float [[POW]]
2644;
2645  %y = call float @llvm.nearbyint.f32(float %y.arg)
2646  %pow = tail call float @_Z3powff(float %x, float %y)
2647  ret float %pow
2648}
2649
2650define float @test_pow_f32__y_known_integral_round(float %x, float nofpclass(inf nan) %y.arg) {
2651; CHECK-LABEL: define float @test_pow_f32__y_known_integral_round
2652; CHECK-SAME: (float [[X:%.*]], float nofpclass(nan inf) [[Y_ARG:%.*]]) {
2653; CHECK-NEXT:    [[Y:%.*]] = call float @llvm.round.f32(float [[Y_ARG]])
2654; CHECK-NEXT:    [[TMP1:%.*]] = fptosi float [[Y]] to i32
2655; CHECK-NEXT:    [[POW:%.*]] = tail call float @_Z4pownfi(float [[X]], i32 [[TMP1]])
2656; CHECK-NEXT:    ret float [[POW]]
2657;
2658  %y = call float @llvm.round.f32(float %y.arg)
2659  %pow = tail call float @_Z3powff(float %x, float %y)
2660  ret float %pow
2661}
2662
2663define float @test_pow_f32__y_known_integral_roundeven(float %x, float nofpclass(inf nan) %y.arg) {
2664; CHECK-LABEL: define float @test_pow_f32__y_known_integral_roundeven
2665; CHECK-SAME: (float [[X:%.*]], float nofpclass(nan inf) [[Y_ARG:%.*]]) {
2666; CHECK-NEXT:    [[Y:%.*]] = call float @llvm.roundeven.f32(float [[Y_ARG]])
2667; CHECK-NEXT:    [[TMP1:%.*]] = fptosi float [[Y]] to i32
2668; CHECK-NEXT:    [[POW:%.*]] = tail call float @_Z4pownfi(float [[X]], i32 [[TMP1]])
2669; CHECK-NEXT:    ret float [[POW]]
2670;
2671  %y = call float @llvm.roundeven.f32(float %y.arg)
2672  %pow = tail call float @_Z3powff(float %x, float %y)
2673  ret float %pow
2674}
2675
2676define float @test_pow_f32_known_integral_undef(float %x) {
2677; CHECK-LABEL: define float @test_pow_f32_known_integral_undef
2678; CHECK-SAME: (float [[X:%.*]]) {
2679; CHECK-NEXT:    [[POW:%.*]] = tail call float @_Z3powff(float [[X]], float undef)
2680; CHECK-NEXT:    ret float [[POW]]
2681;
2682  %pow = tail call float @_Z3powff(float %x, float undef)
2683  ret float %pow
2684}
2685
2686define float @test_pow_f32_known_integral_poison(float %x) {
2687; CHECK-LABEL: define float @test_pow_f32_known_integral_poison
2688; CHECK-SAME: (float [[X:%.*]]) {
2689; CHECK-NEXT:    [[POW:%.*]] = tail call float @_Z4pownfi(float [[X]], i32 poison)
2690; CHECK-NEXT:    ret float [[POW]]
2691;
2692  %pow = tail call float @_Z3powff(float %x, float poison)
2693  ret float %pow
2694}
2695
2696define <2 x float> @test_pow_v2f32_known_integral_constant_vector_undef_elt(<2 x float> %x) {
2697; CHECK-LABEL: define <2 x float> @test_pow_v2f32_known_integral_constant_vector_undef_elt
2698; CHECK-SAME: (<2 x float> [[X:%.*]]) {
2699; CHECK-NEXT:    [[POW:%.*]] = tail call <2 x float> @_Z3powDv2_fS_(<2 x float> [[X]], <2 x float> <float 4.000000e+00, float undef>)
2700; CHECK-NEXT:    ret <2 x float> [[POW]]
2701;
2702  %pow = tail call <2 x float> @_Z3powDv2_fS_(<2 x float> %x, <2 x float> <float 4.0, float undef>)
2703  ret <2 x float> %pow
2704}
2705
2706define <2 x float> @test_pow_v2f32_known_integral_constant_vector_poison_elt(<2 x float> %x) {
2707; CHECK-LABEL: define <2 x float> @test_pow_v2f32_known_integral_constant_vector_poison_elt
2708; CHECK-SAME: (<2 x float> [[X:%.*]]) {
2709; CHECK-NEXT:    [[POW:%.*]] = tail call <2 x float> @_Z4pownDv2_fDv2_i(<2 x float> [[X]], <2 x i32> <i32 4, i32 poison>)
2710; CHECK-NEXT:    ret <2 x float> [[POW]]
2711;
2712  %pow = tail call <2 x float> @_Z3powDv2_fS_(<2 x float> %x, <2 x float> <float 4.0, float poison>)
2713  ret <2 x float> %pow
2714}
2715
2716attributes #0 = { minsize }
2717attributes #1 = { noinline }
2718attributes #2 = { strictfp }
2719attributes #3 = { nobuiltin }
2720