[llvm] [SelectionDAG] Remove `NoNaNsFPMath` in `visitFCmp` (PR #163519)
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Sun Oct 26 18:10:05 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:
I'm not sure it's a good idea to let isKnownNeverNaN inspect the users. Can you drop this from this patch? If we're going to do this, it should be done separately.
https://github.com/llvm/llvm-project/pull/163519
More information about the llvm-commits
mailing list