summaryrefslogtreecommitdiffstats
path: root/clang/lib/Driver/ToolChains.cpp
diff options
context:
space:
mode:
authorJustin Lebar <jlebar@google.com>2016-04-05 18:26:20 +0000
committerJustin Lebar <jlebar@google.com>2016-04-05 18:26:20 +0000
commitd3a44f68854e3e093662117621c607e3361716ec (patch)
tree4cd3258de8a104f97c7b52f829c760cb563d6acf /clang/lib/Driver/ToolChains.cpp
parentf3bb6c51bca341aaa3af0f2e158184bd5bb04553 (diff)
downloadbcm5719-llvm-d3a44f68854e3e093662117621c607e3361716ec.tar.gz
bcm5719-llvm-d3a44f68854e3e093662117621c607e3361716ec.zip
[CUDA] Add -fcuda-flush-denormals-to-zero.
Summary: Setting this flag causes all functions are annotated with the "nvvm-f32ftz" = "true" attribute. In addition, we annotate the module with "nvvm-reflect-ftz" set to 0 or 1, depending on whether -cuda-flush-denormals-to-zero is set. This is read by the NVVMReflect pass. Reviewers: tra, rnk Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D18671 llvm-svn: 265435
Diffstat (limited to 'clang/lib/Driver/ToolChains.cpp')
-rw-r--r--clang/lib/Driver/ToolChains.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/lib/Driver/ToolChains.cpp b/clang/lib/Driver/ToolChains.cpp
index 11ded7cd5eb..902338b2884 100644
--- a/clang/lib/Driver/ToolChains.cpp
+++ b/clang/lib/Driver/ToolChains.cpp
@@ -4208,6 +4208,10 @@ CudaToolChain::addClangTargetOptions(const llvm::opt::ArgList &DriverArgs,
Linux::addClangTargetOptions(DriverArgs, CC1Args);
CC1Args.push_back("-fcuda-is-device");
+ if (DriverArgs.hasFlag(options::OPT_fcuda_flush_denormals_to_zero,
+ options::OPT_fno_cuda_flush_denormals_to_zero, false))
+ CC1Args.push_back("-fcuda-flush-denormals-to-zero");
+
if (DriverArgs.hasArg(options::OPT_nocudalib))
return;
OpenPOWER on IntegriCloud