summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen
diff options
context:
space:
mode:
authorSjoerd Meijer <sjoerd.meijer@arm.com>2016-08-30 08:09:45 +0000
committerSjoerd Meijer <sjoerd.meijer@arm.com>2016-08-30 08:09:45 +0000
commit0a8d4216ad52aeffc14597a2d946134afa0d89ec (patch)
treea93cd5532ced3f54265fdc9fd20b9585d63363e9 /clang/lib/CodeGen
parent5a99207d11f3ea72ca9424596e1d0cdf4bdb9f3f (diff)
downloadbcm5719-llvm-0a8d4216ad52aeffc14597a2d946134afa0d89ec.tar.gz
bcm5719-llvm-0a8d4216ad52aeffc14597a2d946134afa0d89ec.zip
This adds new options -fdenormal-fp-math and passes through option -ffast-math
to CC1, which are translated to function attributes and can e.g. be mapped on build attributes FP_exceptions and FP_denormal. Setting these build attributes allows better selection of floating point libraries. Differential Revision: https://reviews.llvm.org/D23840 llvm-svn: 280064
Diffstat (limited to 'clang/lib/CodeGen')
-rw-r--r--clang/lib/CodeGen/CGCall.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CGCall.cpp b/clang/lib/CodeGen/CGCall.cpp
index 94261bf3155..f3eaef369a6 100644
--- a/clang/lib/CodeGen/CGCall.cpp
+++ b/clang/lib/CodeGen/CGCall.cpp
@@ -1722,6 +1722,13 @@ void CodeGenModule::ConstructAttributeList(
FuncAttrs.addAttribute("less-precise-fpmad",
llvm::toStringRef(CodeGenOpts.LessPreciseFPMAD));
+
+ if (!CodeGenOpts.FPDenormalMode.empty())
+ FuncAttrs.addAttribute("denormal-fp-math",
+ CodeGenOpts.FPDenormalMode);
+
+ FuncAttrs.addAttribute("no-trapping-math",
+ llvm::toStringRef(CodeGenOpts.NoTrappingMath));
FuncAttrs.addAttribute("no-infs-fp-math",
llvm::toStringRef(CodeGenOpts.NoInfsFPMath));
FuncAttrs.addAttribute("no-nans-fp-math",
OpenPOWER on IntegriCloud