summaryrefslogtreecommitdiffstats
path: root/llvm/lib/VMCore/ConstantFolding.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/VMCore/ConstantFolding.cpp')
-rw-r--r--llvm/lib/VMCore/ConstantFolding.cpp7
1 files changed, 1 insertions, 6 deletions
diff --git a/llvm/lib/VMCore/ConstantFolding.cpp b/llvm/lib/VMCore/ConstantFolding.cpp
index 549ac20c3db..521f6b84a25 100644
--- a/llvm/lib/VMCore/ConstantFolding.cpp
+++ b/llvm/lib/VMCore/ConstantFolding.cpp
@@ -295,13 +295,8 @@ Constant *llvm::ConstantFoldCastInstruction(unsigned opc, const Constant *V,
// Handle ConstantFP input.
if (const ConstantFP *FP = dyn_cast<ConstantFP>(V)) {
// FP -> Integral.
- if (DestTy->isInteger()) {
- if (DestTy == Type::Int32Ty)
- return ConstantInt::get(DestTy, FloatToBits(FP->getValue()));
- assert(DestTy == Type::Int64Ty &&
- "Incorrect integer type for bitcast!");
+ if (DestTy->isInteger())
return ConstantInt::get(DestTy, DoubleToBits(FP->getValue()));
- }
}
return 0;
default:
OpenPOWER on IntegriCloud