blob: 0432b67535c0f590c972c8086ff7d765f041a080 [file] [log] [blame]
Justin Holewinskib6e6cd32013-06-21 18:51:49 +00001; RUN: llc < %s -march=nvptx -mcpu=sm_20 | FileCheck %s
2
3target triple = "nvptx-nvidia-cuda"
Justin Holewinski4c47d872013-05-20 16:42:18 +00004
5; Function Attrs: nounwind
6; CHECK: .entry foo
7define void @foo(float* nocapture %a) #0 {
David Blaikiea79ac142015-02-27 21:17:42 +00008 %val = load float, float* %a
Justin Holewinski4c47d872013-05-20 16:42:18 +00009 %tan = tail call fastcc float @__nv_fast_tanf(float %val)
10 store float %tan, float* %a
11 ret void
12}
13
14; Function Attrs: nounwind readnone
15declare float @llvm.nvvm.sin.approx.ftz.f(float) #1
16
17; Function Attrs: nounwind readnone
18declare float @llvm.nvvm.cos.approx.ftz.f(float) #1
19
20; Function Attrs: nounwind readnone
21declare float @llvm.nvvm.div.approx.ftz.f(float, float) #1
22
23; Function Attrs: alwaysinline inlinehint nounwind readnone
24; CHECK: .func (.param .b32 func_retval0) __nv_fast_tanf
25define internal fastcc float @__nv_fast_tanf(float %a) #2 {
26entry:
27 %0 = tail call float @llvm.nvvm.sin.approx.ftz.f(float %a)
28 %1 = tail call float @llvm.nvvm.cos.approx.ftz.f(float %a)
29 %2 = tail call float @llvm.nvvm.div.approx.ftz.f(float %0, float %1)
30 ret float %2
31}
32
33attributes #0 = { nounwind }
34attributes #1 = { nounwind readnone }
35attributes #2 = { alwaysinline inlinehint nounwind readnone }
36
37!nvvm.annotations = !{!0}
38
Duncan P. N. Exon Smithbe7ea192014-12-15 19:07:53 +000039!0 = !{void (float*)* @foo, !"kernel", i32 1}