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
This commit is contained in:
Reid Spencer 2007-03-03 08:32:46 +00:00
parent 1416862d7c
commit a188bbe7ac

View File

@ -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<ConstantFP>(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);