mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-25 00:24:26 +00:00
When attempting to sign-extend an addrec by interpreting
the step value as unsigned, the start value and the addrec itself still need to be treated as signed. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77078 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -923,10 +923,10 @@ const SCEV *ScalarEvolution::getSignExtendExpr(const SCEV *Op,
|
||||
getTruncateOrZeroExtend(Step, Start->getType()));
|
||||
Add = getAddExpr(Start, UMul);
|
||||
OperandExtendedAdd =
|
||||
getAddExpr(getZeroExtendExpr(Start, WideTy),
|
||||
getAddExpr(getSignExtendExpr(Start, WideTy),
|
||||
getMulExpr(getZeroExtendExpr(CastedMaxBECount, WideTy),
|
||||
getZeroExtendExpr(Step, WideTy)));
|
||||
if (getZeroExtendExpr(Add, WideTy) == OperandExtendedAdd)
|
||||
if (getSignExtendExpr(Add, WideTy) == OperandExtendedAdd)
|
||||
// Return the expression with the addrec on the outside.
|
||||
return getAddRecExpr(getSignExtendExpr(Start, Ty),
|
||||
getZeroExtendExpr(Step, Ty),
|
||||
|
Reference in New Issue
Block a user