diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp index 6ea2e2708c162..c052754d52c5b 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp @@ -6233,7 +6233,17 @@ bool SelectionDAG::cannotBeOrderedNegativeFP(SDValue Op) const { if (ConstantFPSDNode *C1 = isConstOrConstSplatFP(Op, true)) return !C1->isNegative(); - return Op.getOpcode() == ISD::FABS; + switch (Op.getOpcode()) { + case ISD::FABS: + case ISD::FEXP: + case ISD::FEXP2: + case ISD::FEXP10: + return true; + default: + return false; + } + + llvm_unreachable("covered opcode switch"); } bool SelectionDAG::isEqualTo(SDValue A, SDValue B) const {