[AMDGPU] Ensure trig range reduction only used for subtargets that require it
authorDavid Stuttard <david.stuttard@amd.com>
Fri, 14 Sep 2018 10:27:19 +0000 (10:27 +0000)
committerDavid Stuttard <david.stuttard@amd.com>
Fri, 14 Sep 2018 10:27:19 +0000 (10:27 +0000)
commit20de3e99b5251fc38adff18ffd55fc98251a2075
tree8a69e7f38a755dd5cd44dd991fa51e9fd50f83cf
parentf051379fbc3fef3b884088082721a15bc8ee1ead
[AMDGPU] Ensure trig range reduction only used for subtargets that require it

Summary:
GFX9 and above support sin/cos instructions with a greater range and thus don't
require a fract instruction prior to invocation.

Added a subtarget feature to reflect this and added code to take advantage of
expanded range on GFX9+

Also updated the tests to check correct behaviour

Subscribers: arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, tpr, t-tye, llvm-commits

Differential Revision: https://reviews.llvm.org/D51933

Change-Id: I1c1f1d3726a5ae32116646ca5cfa1ab4ef69e5b0
llvm-svn: 342222
llvm/lib/Target/AMDGPU/AMDGPU.td
llvm/lib/Target/AMDGPU/AMDGPUSubtarget.cpp
llvm/lib/Target/AMDGPU/AMDGPUSubtarget.h
llvm/lib/Target/AMDGPU/SIISelLowering.cpp
llvm/test/CodeGen/AMDGPU/llvm.cos.f16.ll
llvm/test/CodeGen/AMDGPU/llvm.sin.f16.ll
llvm/test/CodeGen/AMDGPU/llvm.sin.ll