commit | 76c9e0986c42bd789f8734106a86c144f2b5e14c | [log] [tgz] |
---|---|---|
author | Sanjay Patel <spatel@rotateright.com> | Fri Jan 23 16:40:50 2015 +0000 |
committer | Sanjay Patel <spatel@rotateright.com> | Fri Jan 23 16:40:50 2015 +0000 |
tree | ef6d6a0882acfa200c46b841329c519524945579 | |
parent | 6ee521c7eb8b58b5b1faf471bf03da434440bcf0 [diff] [blame] |
Process the -fno-signed-zeros optimization flag (PR20870) The driver currently accepts but ignores the -fno-signed-zeros flag. This patch passes the flag through and enables 'nsz' fast-math-flag generation in IR. The existing OpenCL flag for the same functionality is made into an alias here. It may be removed in a subsequent patch. This should resolve bug 20870 ( http://llvm.org/bugs/show_bug.cgi?id=20870 ); patches for the optimizer were checked in at: http://llvm.org/viewvc/llvm-project?view=revision&revision=225050 http://llvm.org/viewvc/llvm-project?view=revision&revision=224583 Differential Revision: http://reviews.llvm.org/D6873 llvm-svn: 226915
diff --git a/clang/lib/Driver/Tools.cpp b/clang/lib/Driver/Tools.cpp index 680539b..1f0d4f0 100644 --- a/clang/lib/Driver/Tools.cpp +++ b/clang/lib/Driver/Tools.cpp
@@ -2955,6 +2955,8 @@ !TrappingMath) CmdArgs.push_back("-menable-unsafe-fp-math"); + if (!SignedZeros) + CmdArgs.push_back("-fno-signed-zeros"); // Validate and pass through -fp-contract option. if (Arg *A = Args.getLastArg(options::OPT_ffast_math, FastMathAliasOption,