From a188bbe7ac5fd8299530c585966f3305bcc3d95b Mon Sep 17 00:00:00 2001 From: Reid Spencer Date: Sat, 3 Mar 2007 08:32:46 +0000 Subject: Fix constant folding of fp->int bitcast for vectors. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34880 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/VMCore/ConstantFold.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/VMCore') diff --git a/lib/VMCore/ConstantFold.cpp b/lib/VMCore/ConstantFold.cpp index 0d27a88..05a7588 100644 --- a/lib/VMCore/ConstantFold.cpp +++ b/lib/VMCore/ConstantFold.cpp @@ -86,9 +86,9 @@ static Constant *CastConstantVector(ConstantVector *CV, if (SrcEltTy->getTypeID() == Type::DoubleTyID) { for (unsigned i = 0; i != SrcNumElts; ++i) { - double V = + uint64_t V = DoubleToBits(cast(CV->getOperand(i))->getValue()); - Constant *C = ConstantInt::get(APIntOps::RoundDoubleToAPInt(V)); + Constant *C = ConstantInt::get(Type::Int64Ty, V); Result.push_back(ConstantExpr::getBitCast(C, DstEltTy )); } return ConstantVector::get(Result); -- cgit v1.1