Justin Holewinski | b6e6cd3 | 2013-06-21 18:51:49 +0000 | [diff] [blame] | 1 | ; RUN: llc < %s -march=nvptx -mcpu=sm_20 | FileCheck %s |
| 2 | |
| 3 | target triple = "nvptx-nvidia-cuda" |
Justin Holewinski | 4c47d87 | 2013-05-20 16:42:18 +0000 | [diff] [blame] | 4 | |
| 5 | ; Function Attrs: nounwind |
| 6 | ; CHECK: .entry foo |
| 7 | define void @foo(float* nocapture %a) #0 { |
David Blaikie | a79ac14 | 2015-02-27 21:17:42 +0000 | [diff] [blame] | 8 | %val = load float, float* %a |
Justin Holewinski | 4c47d87 | 2013-05-20 16:42:18 +0000 | [diff] [blame] | 9 | %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 |
| 15 | declare float @llvm.nvvm.sin.approx.ftz.f(float) #1 |
| 16 | |
| 17 | ; Function Attrs: nounwind readnone |
| 18 | declare float @llvm.nvvm.cos.approx.ftz.f(float) #1 |
| 19 | |
| 20 | ; Function Attrs: nounwind readnone |
| 21 | declare 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 |
| 25 | define internal fastcc float @__nv_fast_tanf(float %a) #2 { |
| 26 | entry: |
| 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 | |
| 33 | attributes #0 = { nounwind } |
| 34 | attributes #1 = { nounwind readnone } |
| 35 | attributes #2 = { alwaysinline inlinehint nounwind readnone } |
| 36 | |
| 37 | !nvvm.annotations = !{!0} |
| 38 | |
Duncan P. N. Exon Smith | be7ea19 | 2014-12-15 19:07:53 +0000 | [diff] [blame] | 39 | !0 = !{void (float*)* @foo, !"kernel", i32 1} |