mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-10 20:33:15 +00:00
fix a regression introduced by my last patch.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35879 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
ade7592085
commit
ed4e51e58e
@ -970,20 +970,7 @@ void SROA::ConvertUsesToScalar(Value *Ptr, AllocaInst *NewAI, unsigned Offset) {
|
|||||||
if (isa<IntegerType>(LI->getType())) {
|
if (isa<IntegerType>(LI->getType())) {
|
||||||
assert(NV->getType() == LI->getType() && "Truncate wasn't enough?");
|
assert(NV->getType() == LI->getType() && "Truncate wasn't enough?");
|
||||||
} else if (LI->getType()->isFloatingPoint()) {
|
} else if (LI->getType()->isFloatingPoint()) {
|
||||||
// If needed, truncate the integer to the appropriate size.
|
// Just do a bitcast, we know the sizes match up.
|
||||||
if (NTy->getBitWidth() > LIBitWidth) {
|
|
||||||
switch (LI->getType()->getTypeID()) {
|
|
||||||
default: assert(0 && "Unknown FP type!");
|
|
||||||
case Type::FloatTyID:
|
|
||||||
NV = new TruncInst(NV, Type::Int32Ty, LI->getName(), LI);
|
|
||||||
break;
|
|
||||||
case Type::DoubleTyID:
|
|
||||||
NV = new TruncInst(NV, Type::Int64Ty, LI->getName(), LI);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Then do a bitcast.
|
|
||||||
NV = new BitCastInst(NV, LI->getType(), LI->getName(), LI);
|
NV = new BitCastInst(NV, LI->getType(), LI->getName(), LI);
|
||||||
} else {
|
} else {
|
||||||
// Otherwise must be a pointer.
|
// Otherwise must be a pointer.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user