1 ; RUN: llc < %s -march=nvptx64 -mcpu=sm_20 | FileCheck %s
2 ; RUN: %if ptxas %{ llc < %s -march=nvptx64 -mcpu=sm_20 | %ptxas-verify %}
4 target triple = "nvptx-nvidia-cuda"
6 ; Function Attrs: nounwind
8 define void @foo(ptr nocapture %a) #0 {
9 %val = load float, ptr %a
10 %tan = tail call fastcc float @__nv_fast_tanf(float %val)
11 store float %tan, ptr %a
15 ; Function Attrs: nounwind readnone
16 declare float @llvm.nvvm.sin.approx.ftz.f(float) #1
18 ; Function Attrs: nounwind readnone
19 declare float @llvm.nvvm.cos.approx.ftz.f(float) #1
21 ; Function Attrs: nounwind readnone
22 declare float @llvm.nvvm.div.approx.ftz.f(float, float) #1
24 ; Function Attrs: alwaysinline inlinehint nounwind readnone
25 ; CHECK: .func (.param .b32 func_retval0) __nv_fast_tanf
26 define internal fastcc float @__nv_fast_tanf(float %a) #2 {
28 %0 = tail call float @llvm.nvvm.sin.approx.ftz.f(float %a)
29 %1 = tail call float @llvm.nvvm.cos.approx.ftz.f(float %a)
30 %2 = tail call float @llvm.nvvm.div.approx.ftz.f(float %0, float %1)
34 attributes #0 = { nounwind }
35 attributes #1 = { nounwind readnone }
36 attributes #2 = { alwaysinline inlinehint nounwind readnone }
38 !nvvm.annotations = !{!0}
40 !0 = !{ptr @foo, !"kernel", i32 1}