summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/TargetMachine.cpp
diff options
context:
space:
mode:
authorSjoerd Meijer <sjoerd.meijer@arm.com>2016-08-31 14:17:38 +0000
committerSjoerd Meijer <sjoerd.meijer@arm.com>2016-08-31 14:17:38 +0000
commit46b5b8838759324c25affab9e6d0285898d9ae0a (patch)
tree4cdab85bdc7f6372ff9c99fb753d0bdbd27ef48f /llvm/lib/Target/TargetMachine.cpp
parent3042713b4b7a22e8a0c42266668e8eb5cefc4844 (diff)
downloadbcm5719-llvm-46b5b8838759324c25affab9e6d0285898d9ae0a.tar.gz
bcm5719-llvm-46b5b8838759324c25affab9e6d0285898d9ae0a.zip
Clang patch r280064 introduced ways to set the FP exceptions and denormal
types. This is the LLVM counterpart and it adds options that map onto FP exceptions and denormal build attributes allowing better fp math library selections. Differential Revision: https://reviews.llvm.org/D24070 llvm-svn: 280246
Diffstat (limited to 'llvm/lib/Target/TargetMachine.cpp')
-rw-r--r--llvm/lib/Target/TargetMachine.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/llvm/lib/Target/TargetMachine.cpp b/llvm/lib/Target/TargetMachine.cpp
index 82c68505c4e..60505f49a6b 100644
--- a/llvm/lib/Target/TargetMachine.cpp
+++ b/llvm/lib/Target/TargetMachine.cpp
@@ -77,6 +77,16 @@ void TargetMachine::resetTargetOptions(const Function &F) const {
RESET_OPTION(UnsafeFPMath, "unsafe-fp-math");
RESET_OPTION(NoInfsFPMath, "no-infs-fp-math");
RESET_OPTION(NoNaNsFPMath, "no-nans-fp-math");
+ RESET_OPTION(NoTrappingFPMath, "no-trapping-math");
+
+ StringRef Denormal =
+ F.getFnAttribute("denormal-fp-math").getValueAsString();
+ if (Denormal == "ieee")
+ Options.FPDenormalType = FPDenormal::IEEE;
+ else if (Denormal == "preserve-sign")
+ Options.FPDenormalType = FPDenormal::PreserveSign;
+ else if (Denormal == "positive-zero")
+ Options.FPDenormalType = FPDenormal::PositiveZero;
}
/// Returns the code generation relocation model. The choices are static, PIC,
OpenPOWER on IntegriCloud