[clang] Align -ffp-model=fast denormal handling with -ffast-math (PR #89477)
Fangrui Song via cfe-commits
cfe-commits at lists.llvm.org
Wed Apr 24 15:01:12 PDT 2024
================
@@ -1314,11 +1314,17 @@ bool ToolChain::isFastMathRuntimeAvailable(const ArgList &Args,
Arg *A =
Args.getLastArg(options::OPT_ffast_math, options::OPT_fno_fast_math,
options::OPT_funsafe_math_optimizations,
- options::OPT_fno_unsafe_math_optimizations);
+ options::OPT_fno_unsafe_math_optimizations,
+ options::OPT_ffp_model_EQ);
if (!A || A->getOption().getID() == options::OPT_fno_fast_math ||
A->getOption().getID() == options::OPT_fno_unsafe_math_optimizations)
return false;
+ if (A && A->getOption().getID() == options::OPT_ffp_model_EQ) {
+ StringRef Model = A->getValue();
----------------
MaskRay wrote:
Nit: `A->getValue() != "fast"`
inline used-once variable and prefer `==` `!=` for StringRef, which are much more common than `equals`.
https://github.com/llvm/llvm-project/pull/89477
More information about the cfe-commits
mailing list