[llvm] SelectionDAG: Use qNaN constant if FCANONICALIZE not LegalOrCustom (PR #104564)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 3 23:48:12 PDT 2024


================
@@ -8622,8 +8622,16 @@ SDValue TargetLowering::expandFMINIMUMNUM_FMAXIMUMNUM(SDNode *Node,
   // If MinMax is NaN, let's quiet it.
   if (!Flags.hasNoNaNs() && !DAG.isKnownNeverNaN(LHS) &&
       !DAG.isKnownNeverNaN(RHS)) {
-    SDValue MinMaxQuiet =
-        DAG.getNode(ISD::FCANONICALIZE, DL, VT, MinMax, Flags);
+    SDValue MinMaxQuiet;
+    if (isOperationLegalOrCustom(ISD::FCANONICALIZE, VT)) {
----------------
arsenm wrote:

But a nan constant isn't a replacement for a canonicalize. You are breaking any non-nan inputs 

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


More information about the llvm-commits mailing list