mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-05-24 02:38:42 +00:00
Fix bug: 2002-10-02-SignExtensionProblem.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4017 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
51c84d14ab
commit
b6984558c5
@ -147,15 +147,14 @@ const Type *ConvertableToGEP(const Type *Ty, Value *OffsetVal,
|
|||||||
|
|
||||||
if (ScaleAmt && ScaleAmt != 1) {
|
if (ScaleAmt && ScaleAmt != 1) {
|
||||||
// If we have to scale up our index, do so now
|
// If we have to scale up our index, do so now
|
||||||
Value *ScaleAmtVal = ConstantSInt::get(Type::LongTy,
|
Value *ScaleAmtVal = ConstantSInt::get(Type::LongTy, ScaleAmt);
|
||||||
(unsigned)ScaleAmt);
|
|
||||||
Expr.Var = BinaryOperator::create(Instruction::Mul, Expr.Var,
|
Expr.Var = BinaryOperator::create(Instruction::Mul, Expr.Var,
|
||||||
ScaleAmtVal,
|
ScaleAmtVal,
|
||||||
Expr.Var->getName()+"-scale",*BI);
|
Expr.Var->getName()+"-scale",*BI);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Index) { // Add an offset to the index
|
if (Index) { // Add an offset to the index
|
||||||
Value *IndexAmt = ConstantSInt::get(Type::LongTy, (unsigned)Index);
|
Value *IndexAmt = ConstantSInt::get(Type::LongTy, Index);
|
||||||
Expr.Var = BinaryOperator::create(Instruction::Add, Expr.Var,
|
Expr.Var = BinaryOperator::create(Instruction::Add, Expr.Var,
|
||||||
IndexAmt,
|
IndexAmt,
|
||||||
Expr.Var->getName()+"-offset",
|
Expr.Var->getName()+"-offset",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user