Index: llvm/lib/Analysis/ValueTracking.cpp =================================================================== --- llvm/lib/Analysis/ValueTracking.cpp +++ llvm/lib/Analysis/ValueTracking.cpp @@ -4616,8 +4616,9 @@ Op->getOpcode() == Instruction::FAdd && (InterestedClasses & (fcNegative & ~fcNegZero)) != fcNone; bool WantNaN = (InterestedClasses & fcNan) != fcNone; + bool WantNegZero = (InterestedClasses & fcNegZero) != fcNone; - if (!WantNaN && !WantNegative) + if (!WantNaN && !WantNegative && !WantNegZero) break; computeKnownFPClass(Op->getOperand(1), DemandedElts, fcNan | fcInf,