[PATCH] D150728: ValueTracking: Drop rounding mode check for constrained_sqrt in CannotBeNegativeZero

Serge Pavlov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 17 08:33:35 PDT 2023


sepavloff added inline comments.


================
Comment at: llvm/lib/Analysis/ValueTracking.cpp:3809
+      // sqrt(-0.0) = -0.0, no other negative results are possible.
+      // FIXME: Account for denormal-fp-math=preserve-sign denormal inputs
     case Intrinsic::canonicalize:
----------------
arsenm wrote:
> sepavloff wrote:
> > Is this FIXME useful? How could denormal handling change this  behavior?
> If you have preserve-sign inputs, another negative denormal could be implicitly treated as -0 and return -0. This is fixed in the new computeKnownFPClass  implementation 
In this case `CannotBeNegativeZero(Call->getArgOperand(0)...)` returns false and logic of this code remains valid, no? 


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

https://reviews.llvm.org/D150728



More information about the llvm-commits mailing list