diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp @@ -4698,7 +4698,9 @@ case ISD::FDIV: case ISD::FREM: case ISD::FSIN: - case ISD::FCOS: { + case ISD::FCOS: + case ISD::FMA: + case ISD::FMAD: { if (SNaN) return true; // TODO: Need isKnownNeverInfinity @@ -4735,14 +4737,6 @@ case ISD::SINT_TO_FP: case ISD::UINT_TO_FP: return true; - case ISD::FMA: - case ISD::FMAD: { - if (SNaN) - return true; - return isKnownNeverNaN(Op.getOperand(0), SNaN, Depth + 1) && - isKnownNeverNaN(Op.getOperand(1), SNaN, Depth + 1) && - isKnownNeverNaN(Op.getOperand(2), SNaN, Depth + 1); - } case ISD::FSQRT: // Need is known positive case ISD::FLOG: case ISD::FLOG2: