diff options
author | Melanie Blower <melanie.blower@intel.com> | 2020-05-01 06:36:58 -0700 |
---|---|---|
committer | Melanie Blower <melanie.blower@intel.com> | 2020-05-01 06:36:58 -0700 |
commit | 85dc033caccaa6ab919d57f9759290be41240146 (patch) | |
tree | 11d6614b7f06ad9e4631fd64cae3e9a8f66ca7d6 /clang/lib/CodeGen/CodeGenFunction.cpp | |
parent | 5486e00dc3e3bb9969f1e8dbddfd18bb92c99e56 (diff) | |
download | llvm-85dc033caccaa6ab919d57f9759290be41240146.zip llvm-85dc033caccaa6ab919d57f9759290be41240146.tar.gz llvm-85dc033caccaa6ab919d57f9759290be41240146.tar.bz2 |
Revert "Add support for #pragma float_control"
This reverts commit 4f1e9a17e9d28bdfd035313c96b3a5d4c91a7733.
due to fail on buildbot, sorry for the noise
Diffstat (limited to 'clang/lib/CodeGen/CodeGenFunction.cpp')
-rw-r--r-- | clang/lib/CodeGen/CodeGenFunction.cpp | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/clang/lib/CodeGen/CodeGenFunction.cpp b/clang/lib/CodeGen/CodeGenFunction.cpp index 4fcf31a..24e01c4 100644 --- a/clang/lib/CodeGen/CodeGenFunction.cpp +++ b/clang/lib/CodeGen/CodeGenFunction.cpp @@ -117,8 +117,8 @@ CodeGenFunction::~CodeGenFunction() { // Map the LangOption for exception behavior into // the corresponding enum in the IR. -llvm::fp::ExceptionBehavior -clang::ToConstrainedExceptMD(LangOptions::FPExceptionModeKind Kind) { +static llvm::fp::ExceptionBehavior ToConstrainedExceptMD( + LangOptions::FPExceptionModeKind Kind) { switch (Kind) { case LangOptions::FPE_Ignore: return llvm::fp::ebIgnore; @@ -133,10 +133,15 @@ void CodeGenFunction::SetFPModel() { auto fpExceptionBehavior = ToConstrainedExceptMD( getLangOpts().getFPExceptionMode()); - Builder.setDefaultConstrainedRounding(RM); - Builder.setDefaultConstrainedExcept(fpExceptionBehavior); - Builder.setIsFPConstrained(fpExceptionBehavior != llvm::fp::ebIgnore || - RM != llvm::RoundingMode::NearestTiesToEven); + if (fpExceptionBehavior == llvm::fp::ebIgnore && + RM == llvm::RoundingMode::NearestTiesToEven) + // Constrained intrinsics are not used. + ; + else { + Builder.setIsFPConstrained(true); + Builder.setDefaultConstrainedRounding(RM); + Builder.setDefaultConstrainedExcept(fpExceptionBehavior); + } } CharUnits CodeGenFunction::getNaturalPointeeTypeAlignment(QualType T, @@ -914,11 +919,9 @@ void CodeGenFunction::StartFunction(GlobalDecl GD, QualType RetTy, Fn->addFnAttr(llvm::Attribute::NoRecurse); } - if (const FunctionDecl *FD = dyn_cast_or_null<FunctionDecl>(D)) { - Builder.setIsFPConstrained(FD->usesFPIntrin()); + if (const FunctionDecl *FD = dyn_cast_or_null<FunctionDecl>(D)) if (FD->usesFPIntrin()) Fn->addFnAttr(llvm::Attribute::StrictFP); - } // If a custom alignment is used, force realigning to this alignment on // any main function which certainly will need it. |