mirror of
https://github.com/RPCSX/llvm.git
synced 2025-01-06 12:04:52 +00:00
e41bb16926
Previously we'd always lower @llvm.{sin,cos}.f32 to {sin.cos}.approx.f32 instruction even when unsafe FP math was not allowed. Clang-generated IR is not affected by this as it uses precise sin/cos from CUDA's libdevice when unsafe math is disabled. Differential Revision: https://reviews.llvm.org/D28619 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@291936 91177308-0d34-0410-b5e6-96231b3b80d8
15 lines
413 B
LLVM
15 lines
413 B
LLVM
; RUN: not llc < %s -march=nvptx -mcpu=sm_20 2>&1 | FileCheck %s
|
|
|
|
; Check that we fail to select fcos without fast-math enabled
|
|
|
|
declare float @llvm.cos.f32(float)
|
|
|
|
; CHECK: LLVM ERROR: Cannot select: {{.*}}: f32 = fcos
|
|
; CHECK: In function: test_fcos_safe
|
|
define float @test_fcos_safe(float %a) #0 {
|
|
%r = tail call float @llvm.cos.f32(float %a)
|
|
ret float %r
|
|
}
|
|
|
|
attributes #0 = { "unsafe-fp-math" = "false" }
|