Home | History | Annotate | Download | only in Analysis

Lines Matching defs:Step

707   // to do is multiply by the inverse.  Therefore, this step can be done at
711 // is done is by doing the multiplication step at a width of at least W + T
720 // a division step, whereas this formula only requires multiplies and shifts.
722 // It doesn't matter whether the subtraction step is done in the calculation
757 // We need at least W + T bits for the multiplication step
944 const SCEV *Step = AR->getStepRecurrence(*this);
952 getZeroExtendExpr(Step, Ty),
976 // Check whether Start+Step*MaxBECount has no unsigned overflow.
977 const SCEV *ZMul = getMulExpr(CastedMaxBECount, Step);
985 getZeroExtendExpr(Step, WideTy)));
991 getZeroExtendExpr(Step, Ty),
994 // Similar to above, only this time treat the step value as signed.
999 getSignExtendExpr(Step, WideTy)));
1002 // Negative step causes unsigned wrap, but it still can't self-wrap.
1006 getSignExtendExpr(Step, Ty),
1015 if (isKnownPositive(Step)) {
1017 getUnsignedRange(Step).getUnsignedMax());
1026 getZeroExtendExpr(Step, Ty),
1029 } else if (isKnownNegative(Step)) {
1031 getSignedRange(Step).getSignedMin());
1037 // Negative step causes unsigned wrap, but it still can't self-wrap.
1041 getSignExtendExpr(Step, Ty),
1057 // Get the limit of a recurrence such that incrementing by Step cannot cause
1060 static const SCEV *getOverflowLimitForStep(const SCEV *Step,
1063 unsigned BitWidth = SE->getTypeSizeInBits(Step->getType());
1064 if (SE->isKnownPositive(Step)) {
1067 SE->getSignedRange(Step).getSignedMax());
1069 if (SE->isKnownNegative(Step)) {
1072 SE->getSignedRange(Step).getSignedMin());
1080 // such: {sext(Step + Start),+,Step} => {(Step + sext(Start),+,Step} As a
1081 // result, the expression "Step + sext(PreIncAR)" is congruent with
1088 const SCEV *Step = AR->getStepRecurrence(*SE);
1090 // Check for a simple looking step prior to loop entry.
1095 // Create an AddExpr for "PreStart" after subtracting Step. Full SCEV
1097 // difference, by checking for Step in the operand list.
1101 if (*I != Step)
1110 // 1. NSW flags on the step increment.
1113 SE->getAddRecExpr(PreStart, Step, L, SCEV::FlagAnyWrap));
1118 // 2. Direct overflow check on the step operation's expression.
1123 SE->getSignExtendExpr(Step, WideTy));
1135 const SCEV *OverflowLimit = getOverflowLimitForStep(Step, &Pred, SE);
1210 const SCEV *Step = AR->getStepRecurrence(*this);
1218 getSignExtendExpr(Step, Ty),
1242 // Check whether Start+Step*MaxBECount has no signed overflow.
1243 const SCEV *SMul = getMulExpr(CastedMaxBECount, Step);
1251 getSignExtendExpr(Step, WideTy)));
1257 getSignExtendExpr(Step, Ty),
1260 // Similar to above, only this time treat the step value as unsigned.
1261 // This covers loops that count up with an unsigned step.
1265 getZeroExtendExpr(Step, WideTy)));
1271 getZeroExtendExpr(Step, Ty),
1281 const SCEV *OverflowLimit = getOverflowLimitForStep(Step, &Pred, this);
1290 getSignExtendExpr(Step, Ty),
1746 // NLI + LI + {Start,+,Step} --> NLI + {LI+Start,+,Step}
1798 // Step size has changed, so we cannot guarantee no self-wraparound.
2001 // NLI * LI * {Start,+,Step} --> NLI * {LI*Start,+,LI*Step}
2011 // No self-wrap cannot be guaranteed after changing the step size, but
2149 if (const SCEVConstant *Step =
2152 const APInt &StepInt = Step->getValue()->getValue();
2157 getZeroExtendExpr(Step, ExtTy),
2172 getZeroExtendExpr(Step, ExtTy),
2177 LHS = getAddRecExpr(getConstant(StartInt - StartRem), Step,
2243 const SCEV *ScalarEvolution::getAddRecExpr(const SCEV *Start, const SCEV *Step,
2248 if (const SCEVAddRecExpr *StepChrec = dyn_cast<SCEVAddRecExpr>(Step))
2254 Operands.push_back(Step);
2320 // Create a recurrence for the outer loop with the same step size.
3049 // This is not a valid addrec if the step amount is varying each
3102 // initial step of the addrec evolution.
3364 const SCEV *Step = AddRec->getStepRecurrence(*this);
3367 ConstantRange StepRange = getSignedRange(Step);
3515 const SCEV *Step = AddRec->getStepRecurrence(*this);
3518 ConstantRange StepRange = getSignedRange(Step);
3699 // Instcombine turns add of signbit into xor as a strength reduction step.
5473 // Start + Step*N = 0 (mod 2^BW)
5477 // Step*N = -Start (mod 2^BW)
5479 // where BW is the common bit width of Start and Step.
5483 const SCEV *Step = getSCEVAtScope(AddRec->getOperand(1), L->getParentLoop());
5487 // TODO: Handle a nonconstant Step given AddRec<NUW>. If the
5489 // to 0, it must be counting down to equal 0. Consequently, N = Start / -Step.
5491 const SCEVConstant *StepC = dyn_cast<SCEVConstant>(Step);
5496 // N = -Start/Step (as unsigned)
5498 // N = Start/-Step
5499 // First compute the unsigned distance from zero in the direction of Step.
5532 return getUDivExpr(Distance, CountDown ? getNegativeSCEV(Step) : Step);
6255 /// getBECount - Subtract the end and start values and divide by the step,
6260 const SCEV *Step,
6262 assert(!isKnownNegative(Step) &&
6275 const SCEV *RoundUp = getAddExpr(Step, NegOne);
6293 return getUDivExpr(Add, Step);
6316 const SCEV *Step = AddRec->getStepRecurrence(*this);
6318 if (Step->isZero())
6320 if (Step->isOne()) {
6322 } else if (isKnownPositive(Step)) {
6323 // Test whether a positive iteration can step past the limit
6324 // value and past the maximum value for its type in a single step.
6330 const SCEV *One = getConstant(Step->getType(), 1);
6333 if ((Max - getSignedRange(getMinusSCEV(Step, One)).getSignedMax())
6338 if ((Max - getUnsignedRange(getMinusSCEV(Step, One)).getUnsignedMax())
6367 getMinusSCEV(Start, Step), RHS))
6376 // If MaxEnd is within a step of the maximum integer value in its type,
6378 // This allows the subsequent ceiling division of (N+(step-1))/step to
6380 const SCEV *StepMinusOne = getMinusSCEV(Step,
6381 getConstant(Step->getType(), 1));
6392 const SCEV *BECount = getBECount(Start, End, Step, NoWrap);
6398 : getBECount(MinStart, MaxEnd, Step, NoWrap);