mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-14 16:33:28 +00:00
Fix Transforms/ScalarRepl/2006-10-23-PointerUnionCrash.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31151 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
b0d6dbfd7c
commit
ae5d51c9c9
@ -611,11 +611,16 @@ void SROA::ConvertUsesToScalar(Value *Ptr, AllocaInst *NewAI, unsigned Offset) {
|
||||
NV = new ExtractElementInst(NV, ConstantInt::get(Type::UIntTy, Elt),
|
||||
"tmp", LI);
|
||||
} else {
|
||||
assert(NV->getType()->isInteger() && "Unknown promotion!");
|
||||
if (Offset && Offset < TD.getTypeSize(NV->getType())*8)
|
||||
NV = new ShiftInst(Instruction::Shr, NV,
|
||||
ConstantInt::get(Type::UByteTy, Offset),
|
||||
LI->getName(), LI);
|
||||
if (Offset) {
|
||||
assert(NV->getType()->isInteger() && "Unknown promotion!");
|
||||
if (Offset < TD.getTypeSize(NV->getType())*8)
|
||||
NV = new ShiftInst(Instruction::Shr, NV,
|
||||
ConstantInt::get(Type::UByteTy, Offset),
|
||||
LI->getName(), LI);
|
||||
} else {
|
||||
assert((NV->getType()->isInteger() ||
|
||||
isa<PointerType>(NV->getType())) && "Unknown promotion!");
|
||||
}
|
||||
NV = new CastInst(NV, LI->getType(), LI->getName(), LI);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user