[clang] [llvm] Reapply "InstCombine: Introduce SimplifyDemandedUseFPClass"" (PR #74056)

Andy Kaylor via cfe-commits cfe-commits at lists.llvm.org
Thu Dec 21 14:48:14 PST 2023


andykaylor wrote:

For those who haven't already seen it, there was a related discussion here: https://discourse.llvm.org/t/should-isnan-be-optimized-out-in-fast-math-mode/58888

I think that discussion could be fairly summarized by saying that no consensus was reached, and many people wished they had never entered the discussion.

Reviewing this discussion led me to do some experiments and I find that in C++ mode, using -ffinite-math-only cannot be mixed well with "#pragma float_control(precise, on)" or various methods for disabling optimizations altogether, because templates from the header files are instantiated outside the pragmas. That may be defensible behavior, but I suspect it would come as a surprise to people who think they can control fast-math behavior locally.

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


More information about the cfe-commits mailing list