[PATCH] D147871: ValueTracking: Implement computeKnownFPClass for sqrt

Jay Foad via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 16 04:20:12 PDT 2023


foad added inline comments.


================
Comment at: llvm/include/llvm/Analysis/ValueTracking.h:296
 
+  /// Return true if it's know this can never be interpreted as a negative zero.
+  bool isKnownNeverLogicalNegZero(const Function &F, Type *Ty) const;
----------------
"known"


================
Comment at: llvm/lib/Analysis/ValueTracking.cpp:4737-4738
+          Known.knownNot(fcPosInf);
+        if (KnownSrc.isKnownNever(fcSNan))
+          Known.knownNot(fcSNan);
+
----------------
Is this valid? You haven't implemented snan logic for most of the other intrinsics.


================
Comment at: llvm/lib/Analysis/ValueTracking.cpp:4742
+        if (KnownSrc.isKnownNeverNaN() &&
+            KnownSrc.cannotBeOrderedLessThanZero())
+          Known.knownNot(fcNan);
----------------
Should really add OrderedLessThanZeroMask to the InterestedClasses for the recursive call for this case.


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

https://reviews.llvm.org/D147871



More information about the llvm-commits mailing list