mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-05 13:26:55 +00:00
teach GetLinearExpression to be a bit more aggressive.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89955 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -400,7 +400,16 @@ static Value *GetLinearExpression(Value *V, APInt &Scale, APInt &Offset,
|
||||
V = GetLinearExpression(BOp->getOperand(0), Scale, Offset, TD);
|
||||
Offset += RHSC->getValue();
|
||||
return V;
|
||||
// TODO: SHL, MUL.
|
||||
case Instruction::Mul:
|
||||
V = GetLinearExpression(BOp->getOperand(0), Scale, Offset, TD);
|
||||
Offset *= RHSC->getValue();
|
||||
Scale *= RHSC->getValue();
|
||||
return V;
|
||||
case Instruction::Shl:
|
||||
V = GetLinearExpression(BOp->getOperand(0), Scale, Offset, TD);
|
||||
Offset <<= RHSC->getValue().getLimitedValue();
|
||||
Scale <<= RHSC->getValue().getLimitedValue();
|
||||
return V;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user