From 4e0afa2dbbbf53287620461951c012545ab98381 Mon Sep 17 00:00:00 2001 From: Zahira Ammarguellat Date: Wed, 17 Jul 2024 11:03:02 -0700 Subject: [PATCH] Addressed review comments and fixed the -menable_no_infs option. --- clang/include/clang/Driver/Options.td | 2 +- clang/lib/Basic/Targets/OSTargets.cpp | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/clang/include/clang/Driver/Options.td b/clang/include/clang/Driver/Options.td index 512eb93f65e67d..6c72bf149157c6 100644 --- a/clang/include/clang/Driver/Options.td +++ b/clang/include/clang/Driver/Options.td @@ -7762,7 +7762,7 @@ def mreassociate : Flag<["-"], "mreassociate">, def menable_no_nans : Flag<["-"], "menable-no-nans">, HelpText<"Allow optimization to assume there are no NaNs.">, MarshallingInfoFlag>, ImpliedByAnyOf<[ffast_math.KeyPath]>; -def menable_no_infinities : Flag<["-"], "menable-no-infs">, +def menable_no_infs : Flag<["-"], "menable-no-infs">, HelpText<"Allow optimization to assume there are no infinities.">, MarshallingInfoFlag>, ImpliedByAnyOf<[ffast_math.KeyPath]>; diff --git a/clang/lib/Basic/Targets/OSTargets.cpp b/clang/lib/Basic/Targets/OSTargets.cpp index 146257a7d5c169..b56e2c7ca9c494 100644 --- a/clang/lib/Basic/Targets/OSTargets.cpp +++ b/clang/lib/Basic/Targets/OSTargets.cpp @@ -173,11 +173,10 @@ static void addVisualCDefines(const LangOptions &Opts, MacroBuilder &Builder) { // "Under /fp:precise and /fp:strict, the compiler doesn't do any mathematical // transformation unless the transformation is guaranteed to produce a bitwise // identical result." - const bool any_imprecise_flags = - Opts.FastMath || (Opts.NoHonorInfs && Opts.NoHonorNaNs) || - Opts.UnsafeFPMath || Opts.AllowFPReassoc || Opts.NoHonorNaNs || - Opts.NoHonorInfs || Opts.NoSignedZero || Opts.AllowRecip || - Opts.ApproxFunc; + const bool any_imprecise_flags = Opts.FastMath || Opts.UnsafeFPMath || + Opts.AllowFPReassoc || Opts.NoHonorNaNs || + Opts.NoHonorInfs || Opts.NoSignedZero || + Opts.AllowRecip || Opts.ApproxFunc; // "Under both /fp:precise and /fp:fast, the compiler generates code intended // to run in the default floating-point environment."