diff options
author | Yaxun Liu <Yaxun.Liu@amd.com> | 2016-08-09 19:43:38 +0000 |
---|---|---|
committer | Yaxun Liu <Yaxun.Liu@amd.com> | 2016-08-09 19:43:38 +0000 |
commit | 2c17e82bc7b5e812a54cf7eb3a039a2f90bcde28 (patch) | |
tree | ed48514c4289464a7c363b75df188d296633d11b /clang/lib/Frontend/CompilerInstance.cpp | |
parent | a814d89b6156ecd0f8e0256be09bc795389e0909 (diff) | |
download | bcm5719-llvm-2c17e82bc7b5e812a54cf7eb3a039a2f90bcde28.tar.gz bcm5719-llvm-2c17e82bc7b5e812a54cf7eb3a039a2f90bcde28.zip |
[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
Diffstat (limited to 'clang/lib/Frontend/CompilerInstance.cpp')
-rw-r--r-- | clang/lib/Frontend/CompilerInstance.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/lib/Frontend/CompilerInstance.cpp b/clang/lib/Frontend/CompilerInstance.cpp index d440624cc7d..3d37a829000 100644 --- a/clang/lib/Frontend/CompilerInstance.cpp +++ b/clang/lib/Frontend/CompilerInstance.cpp @@ -842,6 +842,9 @@ bool CompilerInstance::ExecuteAction(FrontendAction &Act) { // created. This complexity should be lifted elsewhere. getTarget().adjust(getLangOpts()); + // Adjust target options based on codegen options. + getTarget().adjustTargetOptions(getCodeGenOpts(), getTargetOpts()); + // rewriter project will change target built-in bool type from its default. if (getFrontendOpts().ProgramAction == frontend::RewriteObjC) getTarget().noSignedCharForObjCBool(); |