diff options
Diffstat (limited to 'lib/VMCore/ConstantFold.cpp')
-rw-r--r-- | lib/VMCore/ConstantFold.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/lib/VMCore/ConstantFold.cpp b/lib/VMCore/ConstantFold.cpp index 5c1578f74b..5f7cbcd0b6 100644 --- a/lib/VMCore/ConstantFold.cpp +++ b/lib/VMCore/ConstantFold.cpp @@ -153,12 +153,11 @@ static Constant *FoldBitCast(Constant *V, const Type *DestTy) { // Integral -> Integral. This is a no-op because the bit widths must // be the same. Consequently, we just fold to V. return V; - - if (DestTy->isFloatingPoint()) { - assert((DestTy == Type::DoubleTy || DestTy == Type::FloatTy) && - "Unknown FP type!"); - return ConstantFP::get(APFloat(CI->getValue())); - } + + if (DestTy->isFloatingPoint()) + return ConstantFP::get(APFloat(CI->getValue(), + DestTy != Type::PPC_FP128Ty)); + // Otherwise, can't fold this (vector?) return 0; } |