[ConstantFolding] Fix GetConstantFoldFPValue to avoid cast overflow.
In C++, the behavior of casting a double value that is beyond the range
of a single precision floating-point to a float value is undefined. This
change replaces such a cast with APFloat::convert to convert the value,
which is consistent with how we convert a double value to a half value.
Subscribers: lebedev.ri, sanjoy, jlebar, llvm-commits
Differential Revision: https://reviews.llvm.org/D59500