[llvm] [SelectionDAG] Use `KnownBits` to determine if an operand may be NaN. (PR #188606)
via llvm-commits
llvm-commits at lists.llvm.org
Thu Mar 26 08:49:10 PDT 2026
================
@@ -6251,6 +6193,38 @@ bool SelectionDAG::isKnownNeverNaN(SDValue Op, const APInt &DemandedElts,
Depth);
}
+ // Try to infer NaN from known bits, but only for detecting signaling or
+ // nonsignaling NaNs
+ EVT VT = Op.getValueType();
+ if (!SNaN && VT.isFloatingPoint()) {
----------------
zGoldthorpe wrote:
If `SNaN` is `true`, then `isKnownNeverNaN` ignores quiet NaNs. I want it to be `false` so that `isKnownNeverNaN` considers *all* NaNs.
https://github.com/llvm/llvm-project/pull/188606
More information about the llvm-commits
mailing list