diff options
author | Sjoerd Meijer <sjoerd.meijer@arm.com> | 2016-08-31 14:17:38 +0000 |
---|---|---|
committer | Sjoerd Meijer <sjoerd.meijer@arm.com> | 2016-08-31 14:17:38 +0000 |
commit | 46b5b8838759324c25affab9e6d0285898d9ae0a (patch) | |
tree | 4cdab85bdc7f6372ff9c99fb753d0bdbd27ef48f /llvm/lib/Target/TargetMachine.cpp | |
parent | 3042713b4b7a22e8a0c42266668e8eb5cefc4844 (diff) | |
download | bcm5719-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.cpp | 10 |
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, |