diff options
author | Eric Christopher <echristo@gmail.com> | 2019-11-18 10:45:23 -0800 |
---|---|---|
committer | Eric Christopher <echristo@gmail.com> | 2019-11-18 10:46:48 -0800 |
commit | 30e7ee3c4bac4a12ea584a879aa320bd4e035cc2 (patch) | |
tree | 3c93193eeac41921667a7e2e05fd207cf19670dd /clang/lib/CodeGen/CodeGenFunction.cpp | |
parent | a77b66a05625ea4271c2d76f65428cce02e4699e (diff) | |
download | bcm5719-llvm-30e7ee3c4bac4a12ea584a879aa320bd4e035cc2.tar.gz bcm5719-llvm-30e7ee3c4bac4a12ea584a879aa320bd4e035cc2.zip |
Temporarily Revert "Add support for options -frounding-math, ftrapping-math, -ffp-model=, and -ffp-exception-behavior="
and a follow-up NFC rearrangement as it's causing a crash on valid. Testcase is on the original review thread.
This reverts commits af57dbf12e54f3a8ff48534bf1078f4de104c1cd and e6584b2b7b2de06f1e59aac41971760cac1e1b79
Diffstat (limited to 'clang/lib/CodeGen/CodeGenFunction.cpp')
-rw-r--r-- | clang/lib/CodeGen/CodeGenFunction.cpp | 48 |
1 files changed, 0 insertions, 48 deletions
diff --git a/clang/lib/CodeGen/CodeGenFunction.cpp b/clang/lib/CodeGen/CodeGenFunction.cpp index b853401ebdc..6f2bd8c16b3 100644 --- a/clang/lib/CodeGen/CodeGenFunction.cpp +++ b/clang/lib/CodeGen/CodeGenFunction.cpp @@ -33,8 +33,6 @@ #include "clang/Frontend/FrontendDiagnostic.h" #include "llvm/IR/DataLayout.h" #include "llvm/IR/Dominators.h" -#include "llvm/IR/FPEnv.h" -#include "llvm/IR/IntrinsicInst.h" #include "llvm/IR/Intrinsics.h" #include "llvm/IR/MDBuilder.h" #include "llvm/IR/Operator.h" @@ -89,7 +87,6 @@ CodeGenFunction::CodeGenFunction(CodeGenModule &cgm, bool suppressNewContext) FMF.setAllowReassoc(); } Builder.setFastMathFlags(FMF); - SetFPModel(); } CodeGenFunction::~CodeGenFunction() { @@ -105,51 +102,6 @@ CodeGenFunction::~CodeGenFunction() { CGM.getOpenMPRuntime().functionFinished(*this); } -// Map the LangOption for rounding mode into -// the corresponding enum in the IR. -static llvm::fp::RoundingMode ToConstrainedRoundingMD( - LangOptions::FPRoundingModeKind Kind) { - - switch (Kind) { - case LangOptions::FPR_ToNearest: return llvm::fp::rmToNearest; - case LangOptions::FPR_Downward: return llvm::fp::rmDownward; - case LangOptions::FPR_Upward: return llvm::fp::rmUpward; - case LangOptions::FPR_TowardZero: return llvm::fp::rmTowardZero; - case LangOptions::FPR_Dynamic: return llvm::fp::rmDynamic; - } - llvm_unreachable("Unsupported FP RoundingMode"); -} - -// Map the LangOption for exception behavior into -// the corresponding enum in the IR. -static llvm::fp::ExceptionBehavior ToConstrainedExceptMD( - LangOptions::FPExceptionModeKind Kind) { - - switch (Kind) { - case LangOptions::FPE_Ignore: return llvm::fp::ebIgnore; - case LangOptions::FPE_MayTrap: return llvm::fp::ebMayTrap; - case LangOptions::FPE_Strict: return llvm::fp::ebStrict; - } - llvm_unreachable("Unsupported FP Exception Behavior"); -} - -void CodeGenFunction::SetFPModel() { - auto fpRoundingMode = ToConstrainedRoundingMD( - getLangOpts().getFPRoundingMode()); - auto fpExceptionBehavior = ToConstrainedExceptMD( - getLangOpts().getFPExceptionMode()); - - if (fpExceptionBehavior == llvm::fp::ebIgnore && - fpRoundingMode == llvm::fp::rmToNearest) - // Constrained intrinsics are not used. - ; - else { - Builder.setIsFPConstrained(true); - Builder.setDefaultConstrainedRounding(fpRoundingMode); - Builder.setDefaultConstrainedExcept(fpExceptionBehavior); - } -} - CharUnits CodeGenFunction::getNaturalPointeeTypeAlignment(QualType T, LValueBaseInfo *BaseInfo, TBAAAccessInfo *TBAAInfo) { |