[PATCH] D143074: [LangRef] improve documentation of SNaN in the default FP environment

Mak Nazečić-Andrlon via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 8 00:26:05 PST 2023


Muon added a comment.

In D143074#4110459 <https://reviews.llvm.org/D143074#4110459>, @spatel wrote:

> Agreed - we're not changing the default LLVM behavior with this patch, and I have not heard any reasons why we should. IEEE-754-compliant SNaN handling isn't important enough to the majority of FP users to justify FP performance regressions.

Although I am uncertain about the consequences of changing LLVM's defaults, I would like to point out that there may not actually be a performance impact to handling signaling NaNs correctly. Replacing `x * 1.0` (and the like) with `x` **is** sound whenever the only uses of `x` are in quieting floating-point operations (that is, +, -, *, /, fma, rem, sqrt, but not bitwise ops such as negate, abs or copySign). It would pretty much only affect cases where someone was just performing an isolated multiplication by 1 and returning that. (Such as, say, someone trying to quiet a possible-signaling value.)


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D143074/new/

https://reviews.llvm.org/D143074



More information about the llvm-commits mailing list