[PATCH] D143195: ValueTracking: Add start of computeKnownFPClass API
Matt Arsenault via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Feb 15 05:43:01 PST 2023
arsenm added inline comments.
================
Comment at: llvm/include/llvm/Analysis/ValueTracking.h:217-221
+ /// If the sign bit is definitively known to be 1.
+ bool SignBitKnownOne = false;
+
+ /// If the sign bit is definitively known to be 0.
+ bool SignBitKnownZero = false;
----------------
jcranmer-intel wrote:
> Would it make sense instead to have a `std::optional<bool> KnownSignBit` here?
Annoyingly operator &/|/^ don't work on std::optional<bool> so I think this made some of the patch a bit uglier
================
Comment at: llvm/lib/Analysis/ValueTracking.cpp:4111-4113
+ // Cannot produce nan
+ Known.KnownFPClasses =
+ static_cast<FPClassTest>(Known.KnownFPClasses & ~fcNan & fcAllFlags);
----------------
jcranmer-intel wrote:
> This pattern is common enough that I think `KnownFPClass` should have a `ruleOut(FPClassTest)` method or something similar to implement this method.
knownNot?
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D143195/new/
https://reviews.llvm.org/D143195
More information about the llvm-commits
mailing list