]> granicus.if.org Git - llvm/commit
[NVPTX] Only lower sin/cos to approximate instructions if unsafe math is allowed.
authorArtem Belevich <tra@google.com>
Fri, 13 Jan 2017 18:48:13 +0000 (18:48 +0000)
committerArtem Belevich <tra@google.com>
Fri, 13 Jan 2017 18:48:13 +0000 (18:48 +0000)
commite41bb16926b81017db97ab76b45a80879865a275
treec0b92ca4eec727ec7c86af3fd7d00c64a5dd6730
parent093d956dc6acad0fcf51cc1c31bb9ce42a4bc811
[NVPTX] Only lower sin/cos to approximate instructions if unsafe math is allowed.

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
lib/Target/NVPTX/NVPTXISelDAGToDAG.cpp
lib/Target/NVPTX/NVPTXISelDAGToDAG.h
lib/Target/NVPTX/NVPTXISelLowering.cpp
lib/Target/NVPTX/NVPTXISelLowering.h
lib/Target/NVPTX/NVPTXInstrInfo.td
test/CodeGen/NVPTX/fast-math.ll
test/CodeGen/NVPTX/fcos-no-fast-math.ll [new file with mode: 0644]
test/CodeGen/NVPTX/fsin-no-fast-math.ll [new file with mode: 0644]