[PATCH] D61916: Teach InstSimplify transform -X + X --> 0.0 about unary FNeg

Cameron McInally via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 15 09:47:03 PDT 2019


cameron.mcinally added a comment.

In D61916#1503222 <https://reviews.llvm.org/D61916#1503222>, @kpn wrote:

> If I recall, fneg is not a constrained intrinsic because an fneg will never itself trap.


That's right.

> But a transform of -inf+inf to zero would be invalid by the standard, would it not? Section 7.2 paragraph d? Do we have a way of noting strict conformance to IEEE is required/desired without constrained intrinsics?

So this xform only happens under nnan. IEEE-754 specifies that FAdd(+inf,-inf) --> QNaN. I'm not certain about what LLVM does under nnan in all cases, but we've definitely already diverged from IEEE-754 if there are no NaNs.


Repository:
  rL LLVM

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

https://reviews.llvm.org/D61916





More information about the llvm-commits mailing list