[clang] [clang][Driver] Restore -cl-fast-relaxed-math fast-math cascade at cc1 level (PR #211768)

Hardik Kumar via cfe-commits cfe-commits at lists.llvm.org
Fri Jul 24 04:35:04 PDT 2026


================
@@ -8773,12 +8774,18 @@ let Visibility = [CC1Option, FC1Option] in {
 def mreassociate : Flag<["-"], "mreassociate">,
   HelpText<"Allow reassociation transformations for floating-point instructions">,
   MarshallingInfoFlag<LangOpts<"AllowFPReassoc">>, ImpliedByAnyOf<[funsafe_math_optimizations.KeyPath]>;
-def menable_no_nans : Flag<["-"], "menable-no-nans">,
-  HelpText<"Allow optimization to assume there are no NaNs.">,
-  MarshallingInfoFlag<LangOpts<"NoHonorNaNs">>, ImpliedByAnyOf<[ffast_math.KeyPath]>;
-def menable_no_infs : Flag<["-"], "menable-no-infs">,
-  HelpText<"Allow optimization to assume there are no infinities.">,
-  MarshallingInfoFlag<LangOpts<"NoHonorInfs">>, ImpliedByAnyOf<[ffast_math.KeyPath]>;
+defm enable_no_nans : BoolMOption<"enable-no-nans",
+  LangOpts<"NoHonorNaNs">, DefaultFalse,
+  PosFlag<SetTrue, [], [CC1Option, FC1Option],
+          "Allow optimization to assume there are no NaNs.",
+          [ffast_math.KeyPath]>,
+  NegFlag<SetFalse, [], [CC1Option, FC1Option]>>;
+defm enable_no_infs : BoolMOption<"enable-no-infs",
+  LangOpts<"NoHonorInfs">, DefaultFalse,
+  PosFlag<SetTrue, [], [CC1Option, FC1Option],
+          "Allow optimization to assume there are no infinities.",
+          [ffast_math.KeyPath]>,
----------------
hardikxk wrote:

I am not sure how this is making a difference since `ffast-math` would naturally trigger this so adding this KeyPath doesn't make much sense to me? (given I don't have much experience but I would like some explanation or clarification of my presumable assumptions).

https://github.com/llvm/llvm-project/pull/211768


More information about the cfe-commits mailing list