[PATCH] D83601: [ValueTracking] fix bug in maxnum case of cannotBeOrderedLessThanZeroImpl (PR46627)

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 13 10:44:58 PDT 2020


efriedma added inline comments.


================
Comment at: llvm/lib/Analysis/ValueTracking.cpp:3383
+      return (isPositiveNum(V0) && CannotBeNegativeZero(V1, TLI, Depth + 1)) ||
+             (isPositiveNum(V1) && CannotBeNegativeZero(V0, TLI, Depth + 1));
+    }
----------------
efriedma wrote:
> efriedma wrote:
> > Can you just pass false for "SignBitOnly", instead of doing a bunch of extra calls?
> Err, nevermind, that doesn't work; I need more coffee this morning.
Hopefully correct this time:

If SignBitOnly is false, the current code is correct, I think.  The sign bit of zero doesn't matter.

If SignBitOnly is true, there are two possible proof methods:

1. Neither operand has the sign bit set.
2. Either operand is strictly greater than zero.


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

https://reviews.llvm.org/D83601





More information about the llvm-commits mailing list