[OpenCL][AMDGPU] Add support for -cl-denorms-are-zero
authorYaxun Liu <Yaxun.Liu@amd.com>
Tue, 9 Aug 2016 19:43:38 +0000 (19:43 +0000)
committerYaxun Liu <Yaxun.Liu@amd.com>
Tue, 9 Aug 2016 19:43:38 +0000 (19:43 +0000)
commit2c17e82bc7b5e812a54cf7eb3a039a2f90bcde28
treeed48514c4289464a7c363b75df188d296633d11b
parenta814d89b6156ecd0f8e0256be09bc795389e0909
[OpenCL][AMDGPU] Add support for -cl-denorms-are-zero

Adjust target features for amdgcn target when -cl-denorms-are-zero is set.

Denormal support is controlled by feature strings fp32-denormals fp64-denormals in amdgcn target. If -cl-denorms-are-zero is not set and the command line does not set fp32/64-denormals feature string, +fp32-denormals +fp64-denormals will be on for GPU's supporting them.

A new virtual function virtual void TargetInfo::adjustTargetOptions(const CodeGenOptions &CGOpts, TargetOptions &TargetOpts) const is introduced to allow adjusting target option by codegen option.

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

llvm-svn: 278151
clang/include/clang/Basic/TargetInfo.h
clang/include/clang/Frontend/CodeGenOptions.def
clang/lib/Basic/Targets.cpp
clang/lib/Frontend/CompilerInstance.cpp
clang/lib/Frontend/CompilerInvocation.cpp
clang/test/CodeGenOpenCL/denorms-are-zero.cl