[clang] Disable FTZ/DAZ when compiling shared libraries by default. (PR #80475)

James Y Knight via cfe-commits cfe-commits at lists.llvm.org
Wed Feb 7 10:46:50 PST 2024


jyknight wrote:

> > > > So, alternatively...we could just go with the simplest solution, and use "ieee" as the default even under -ffast-math.
> > 
> > 
> > +1. **There hasn't been a performance reason to use FTZ/DAZ since ~2011.** Maybe there's still a power benefit? But in that case you could still explicitly request the flush separate from -ffast-math
> 
> I don't think this is correct. I know there have been improvements, but there are still cases where setting ftz can have a significant performance impact.

Just to be clear: I'm not proposing entirely eliminating the "link against crtfastmath.o" behavior, when linking a binary with `-ffast-math` (though, separately from _this_ review, that may be worth considering!). I only meant we should stop attempting to infer anything about `-fdenormal-fp-math` due to using `-ffast-math`. (as per the other paragraph in my last comment).

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


More information about the cfe-commits mailing list