[llvm] [SelectionDAG] Remove `NoNaNsFPMath` in `visitFCmp` (PR #163519)
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Sun Oct 26 21:42:09 PDT 2025
================
@@ -5869,6 +5869,12 @@ bool SelectionDAG::isKnownNeverNaN(SDValue Op, bool SNaN,
? APInt::getAllOnes(VT.getVectorNumElements())
: APInt(1, 1);
+ // If all users of this operand is annotated with nnan, we can assume
+ // this operand is not NaN, since nnan also affects inputs.
+ if (llvm::all_of(Op->users(),
+ [](const SDNode *N) { return N->getFlags().hasNoNaNs(); }))
+ return true;
----------------
arsenm wrote:
that seems like it should be fixed by a more specific use context combine
https://github.com/llvm/llvm-project/pull/163519
More information about the llvm-commits
mailing list