[llvm] [DAG] Lower frem of power-2 using div/trunc/mul+sub (PR #91148)

Jay Foad via llvm-commits llvm-commits at lists.llvm.org
Thu May 9 04:12:28 PDT 2024


================
@@ -5567,7 +5567,7 @@ bool SelectionDAG::isKnownNeverZero(SDValue Op, unsigned Depth) const {
 
 bool SelectionDAG::isKnownNonNegativeFP(SDValue Op) const {
   if (ConstantFPSDNode *C1 = isConstOrConstSplatFP(Op, true))
-    return !C1->isNegative();
+    return !C1->isNegative() && !C1->isNaN();
----------------
jayfoad wrote:

I'm not sure this is appropriate since the result of the FABS case below could still be NaN. What is the exact spec of this function?

https://github.com/llvm/llvm-project/pull/91148


More information about the llvm-commits mailing list