diff --git a/llvm/lib/VMCore/ConstantFold.cpp b/llvm/lib/VMCore/ConstantFold.cpp index 0c1d7f73ae1c..d8b8566193ae 100644 --- a/llvm/lib/VMCore/ConstantFold.cpp +++ b/llvm/lib/VMCore/ConstantFold.cpp @@ -196,7 +196,7 @@ Constant *llvm::ConstantFoldCastInstruction(unsigned opc, const Constant *V, uint32_t DestBitWidth = cast(DestTy)->getBitWidth(); APFloat::opStatus status = V.convertToInteger(x, DestBitWidth, opc==Instruction::FPToSI, - APFloat::rmNearestTiesToEven); + APFloat::rmTowardZero); if (status!=APFloat::opOK && status!=APFloat::opInexact) return 0; // give up APInt Val(DestBitWidth, 2, x);