mirror of
https://github.com/RPCS3/llvm.git
synced 2024-12-14 07:31:53 +00:00
trunc to integer, not to FP.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32426 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
d36a76d655
commit
509f85140c
@ -660,8 +660,17 @@ void SROA::ConvertUsesToScalar(Value *Ptr, AllocaInst *NewAI, unsigned Offset) {
|
||||
} else if (LI->getType()->isFloatingPoint()) {
|
||||
// If needed, truncate the integer to the appropriate size.
|
||||
if (NV->getType()->getPrimitiveSize() >
|
||||
LI->getType()->getPrimitiveSize())
|
||||
NV = new TruncInst(NV, LI->getType(), LI->getName(), LI);
|
||||
LI->getType()->getPrimitiveSize()) {
|
||||
switch (LI->getType()->getTypeID()) {
|
||||
default: assert(0 && "Unknown FP type!");
|
||||
case Type::FloatTyID:
|
||||
NV = new TruncInst(NV, Type::UIntTy, LI->getName(), LI);
|
||||
break;
|
||||
case Type::DoubleTyID:
|
||||
NV = new TruncInst(NV, Type::ULongTy, LI->getName(), LI);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Then do a bitcast.
|
||||
NV = new BitCastInst(NV, LI->getType(), LI->getName(), LI);
|
||||
|
Loading…
Reference in New Issue
Block a user