mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-02-01 05:01:59 +01:00
f0d4a0534b
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 llvm-svn: 291936
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 fsin without fast-math enabled
|
|
|
|
declare float @llvm.sin.f32(float)
|
|
|
|
; CHECK: LLVM ERROR: Cannot select: {{.*}}: f32 = fsin
|
|
; CHECK: In function: test_fsin_safe
|
|
define float @test_fsin_safe(float %a) #0 {
|
|
%r = tail call float @llvm.sin.f32(float %a)
|
|
ret float %r
|
|
}
|
|
|
|
attributes #0 = { "unsafe-fp-math" = "false" }
|