Skip to content

Commit 31dcdac

Browse files
committed
SelectionDAG/expandFMINIMUMNUM_FMAXIMUMNUM: FCANONICALIZE is needed only for sNaN
If we are sure that it is not sNaN, even it may be qNaN, we can use it directly.
1 parent ba4bcce commit 31dcdac

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8614,8 +8614,8 @@ SDValue TargetLowering::expandFMINIMUMNUM_FMAXIMUMNUM(SDNode *Node,
86148614
SDValue MinMax =
86158615
DAG.getSelectCC(DL, LHS, RHS, LHS, RHS, IsMax ? ISD::SETGT : ISD::SETLT);
86168616
// If MinMax is NaN, let's quiet it.
8617-
if (!Flags.hasNoNaNs() && !DAG.isKnownNeverNaN(LHS) &&
8618-
!DAG.isKnownNeverNaN(RHS)) {
8617+
if (!Flags.hasNoNaNs() && !DAG.isKnownNeverSNaN(LHS) &&
8618+
!DAG.isKnownNeverSNaN(RHS)) {
86198619
MinMax = DAG.getNode(ISD::FCANONICALIZE, DL, VT, MinMax, Flags);
86208620
}
86218621

0 commit comments

Comments
 (0)