[llvm] SelectionDAG: Support nofpclass(nan/qnan/snan/nzero) in arguments (PR #130051)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 17 05:26:57 PDT 2025


================
@@ -5603,7 +5603,12 @@ bool SelectionDAG::isBaseWithConstantOffset(SDValue Op) const {
 
 bool SelectionDAG::isKnownNeverNaN(SDValue Op, bool SNaN, unsigned Depth) const {
   // If we're told that NaNs won't happen, assume they won't.
-  if (getTarget().Options.NoNaNsFPMath || Op->getFlags().hasNoNaNs())
+  if (getTarget().Options.NoNaNsFPMath)
+    return true;
+  SDNodeFlags OpFlags = Op->getFlags();
+  if (SNaN && OpFlags.hasNoSNaNs())
+    return true;
----------------
arsenm wrote:

Shouldn't need to touch the flags. This code should be directly inspecting AssertNoFPClass's carried mask 

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


More information about the llvm-commits mailing list