git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@365067
91177308-0d34-0410-b5e6-
96231b3b80d8
Count = Count.zext(CmpIndVarSize);
if (UsePostInc)
++Count;
- APInt NewLimit;
- if (cast<SCEVConstant>(ARStep)->getValue()->isNegative())
- NewLimit = Start - Count;
- else
- NewLimit = Start + Count;
+ assert(cast<SCEVConstant>(ARStep)->getValue()->isOne());
+ APInt NewLimit = Start + Count;
ExitCnt = ConstantInt::get(CmpIndVar->getType(), NewLimit);
} else {
// We try to extend trip count first. If that doesn't work we truncate IV.