From 2c17e82bc7b5e812a54cf7eb3a039a2f90bcde28 Mon Sep 17 00:00:00 2001 From: Yaxun Liu Date: Tue, 9 Aug 2016 19:43:38 +0000 Subject: [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/lib/Frontend/CompilerInvocation.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'clang/lib/Frontend/CompilerInvocation.cpp') diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp index 9a18a63..bbb7f2b 100644 --- a/clang/lib/Frontend/CompilerInvocation.cpp +++ b/clang/lib/Frontend/CompilerInvocation.cpp @@ -571,6 +571,7 @@ static bool ParseCodeGenArgs(CodeGenOptions &Opts, ArgList &Args, InputKind IK, Args.hasArg(OPT_cl_fast_relaxed_math)); Opts.NoSignedZeros = (Args.hasArg(OPT_fno_signed_zeros) || Args.hasArg(OPT_cl_no_signed_zeros)); + Opts.FlushDenorm = Args.hasArg(OPT_cl_denorms_are_zero); Opts.ReciprocalMath = Args.hasArg(OPT_freciprocal_math); Opts.NoZeroInitializedInBSS = Args.hasArg(OPT_mno_zero_initialized_in_bss); Opts.BackendOptions = Args.getAllArgValues(OPT_backend_option); -- cgit v1.1