[PATCH] D137811: InstCombine: Perform basic isnan combines on llvm.is.fpclass

Serge Pavlov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 16 06:32:37 PST 2023


sepavloff added a comment.
Herald added a subscriber: StephenFan.

Early conversion `is_fpclass`->`fcmp` may result in incorrect semantics. It make the code:

  if (!isnan(x)) {
  …
  }

indistinguishable from:

  if (x == x) {
  …
  }

But they have different behavior if `x` is signaling NaN. Although the replacement is proposed for strictfp functions only, inlining may require conversion to a form that uses constrained intrinsics. The resulting code would have different behavior than original.


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

https://reviews.llvm.org/D137811



More information about the llvm-commits mailing list