mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-11-01 15:17:25 +00:00
Fix a compile crash on spiff
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19552 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -2123,16 +2123,13 @@ static Value *EmitGEPOffset(User *GEP, Instruction &I, InstCombiner &IC) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
//if (Op->getType() != Scale->getType())
|
|
||||||
if (Size != 1) {
|
|
||||||
// Convert to correct type.
|
// Convert to correct type.
|
||||||
Op = IC.InsertNewInstBefore(new CastInst(Op, SIntPtrTy,
|
Op = IC.InsertNewInstBefore(new CastInst(Op, SIntPtrTy,
|
||||||
Op->getName()+".c"), I);
|
Op->getName()+".c"), I);
|
||||||
|
if (Size != 1)
|
||||||
// We'll let instcombine(mul) convert this to a shl if possible.
|
// We'll let instcombine(mul) convert this to a shl if possible.
|
||||||
Op = IC.InsertNewInstBefore(BinaryOperator::createMul(Op, Scale,
|
Op = IC.InsertNewInstBefore(BinaryOperator::createMul(Op, Scale,
|
||||||
GEP->getName()+".idx"), I);
|
GEP->getName()+".idx"), I);
|
||||||
}
|
|
||||||
|
|
||||||
// Emit an add instruction.
|
// Emit an add instruction.
|
||||||
Result = IC.InsertNewInstBefore(BinaryOperator::createAdd(Op, Result,
|
Result = IC.InsertNewInstBefore(BinaryOperator::createAdd(Op, Result,
|
||||||
|
|||||||
Reference in New Issue
Block a user