Lines Matching defs:Step
709 // to do is multiply by the inverse. Therefore, this step can be done at
713 // is done is by doing the multiplication step at a width of at least W + T
722 // a division step, whereas this formula only requires multiplies and shifts.
724 // It doesn't matter whether the subtraction step is done in the calculation
759 // We need at least W + T bits for the multiplication step
946 const SCEV *Step = AR->getStepRecurrence(*this);
954 getZeroExtendExpr(Step, Ty),
978 // Check whether Start+Step*MaxBECount has no unsigned overflow.
979 const SCEV *ZMul = getMulExpr(CastedMaxBECount, Step);
987 getZeroExtendExpr(Step, WideTy)));
993 getZeroExtendExpr(Step, Ty),
996 // Similar to above, only this time treat the step value as signed.
1001 getSignExtendExpr(Step, WideTy)));
1004 // Negative step causes unsigned wrap, but it still can't self-wrap.
1008 getSignExtendExpr(Step, Ty),
1017 if (isKnownPositive(Step)) {
1019 getUnsignedRange(Step).getUnsignedMax());
1028 getZeroExtendExpr(Step, Ty),
1031 } else if (isKnownNegative(Step)) {
1033 getSignedRange(Step).getSignedMin());
1039 // Negative step causes unsigned wrap, but it still can't self-wrap.
1043 getSignExtendExpr(Step, Ty),
1059 // Get the limit of a recurrence such that incrementing by Step cannot cause
1062 static const SCEV *getOverflowLimitForStep(const SCEV *Step,
1065 unsigned BitWidth = SE->getTypeSizeInBits(Step->getType());
1066 if (SE->isKnownPositive(Step)) {
1069 SE->getSignedRange(Step).getSignedMax());
1071 if (SE->isKnownNegative(Step)) {
1074 SE->getSignedRange(Step).getSignedMin());
1082 // such: {sext(Step + Start),+,Step} => {(Step + sext(Start),+,Step} As a
1083 // result, the expression "Step + sext(PreIncAR)" is congruent with
1090 const SCEV *Step = AR->getStepRecurrence(*SE);
1092 // Check for a simple looking step prior to loop entry.
1097 // Create an AddExpr for "PreStart" after subtracting Step. Full SCEV
1099 // difference, by checking for Step in the operand list.
1102 if (Op != Step)
1111 // 1. NSW flags on the step increment.
1114 SE->getAddRecExpr(PreStart, Step, L, SCEV::FlagAnyWrap));
1119 // 2. Direct overflow check on the step operation's expression.
1124 SE->getSignExtendExpr(Step, WideTy));
1136 const SCEV *OverflowLimit = getOverflowLimitForStep(Step, &Pred, SE);
1228 const SCEV *Step = AR->getStepRecurrence(*this);
1236 getSignExtendExpr(Step, Ty),
1260 // Check whether Start+Step*MaxBECount has no signed overflow.
1261 const SCEV *SMul = getMulExpr(CastedMaxBECount, Step);
1269 getSignExtendExpr(Step, WideTy)));
1275 getSignExtendExpr(Step, Ty),
1278 // Similar to above, only this time treat the step value as unsigned.
1279 // This covers loops that count up with an unsigned step.
1283 getZeroExtendExpr(Step, WideTy)));
1289 getZeroExtendExpr(Step, Ty),
1299 const SCEV *OverflowLimit = getOverflowLimitForStep(Step, &Pred, this);
1308 getSignExtendExpr(Step, Ty),
1312 // If Start and Step are constants, check if we can apply this
1316 auto SC2 = dyn_cast<SCEVConstant>(Step);
1323 const SCEV *NewAR = getAddRecExpr(getConstant(AR->getType(), 0), Step,
1779 // NLI + LI + {Start,+,Step} --> NLI + {LI+Start,+,Step}
1831 // Step size has changed, so we cannot guarantee no self-wraparound.
2034 // NLI * LI * {Start,+,Step} --> NLI * {LI*Start,+,LI*Step}
2044 // No self-wrap cannot be guaranteed after changing the step size, but
2182 if (const SCEVConstant *Step =
2185 const APInt &StepInt = Step->getValue()->getValue();
2190 getZeroExtendExpr(Step, ExtTy),
2205 getZeroExtendExpr(Step, ExtTy),
2210 LHS = getAddRecExpr(getConstant(StartInt - StartRem), Step,
2347 const SCEV *ScalarEvolution::getAddRecExpr(const SCEV *Start, const SCEV *Step,
2352 if (const SCEVAddRecExpr *StepChrec = dyn_cast<SCEVAddRecExpr>(Step))
2358 Operands.push_back(Step);
2424 // Create a recurrence for the outer loop with the same step size.
3177 // This is not a valid addrec if the step amount is varying each
3241 // initial step of the addrec evolution.
3500 const SCEV *Step = AddRec->getStepRecurrence(*this);
3503 ConstantRange StepRange = getSignedRange(Step);
3651 const SCEV *Step = AddRec->getStepRecurrence(*this);
3654 ConstantRange StepRange = getSignedRange(Step);
3842 // Instcombine turns add of signbit into xor as a strength reduction step.
5740 // Start + Step*N = 0 (mod 2^BW)
5744 // Step*N = -Start (mod 2^BW)
5746 // where BW is the common bit width of Start and Step.
5750 const SCEV *Step = getSCEVAtScope(AddRec->getOperand(1), L->getParentLoop());
5754 // TODO: Handle a nonconstant Step given AddRec<NUW>. If the
5756 // to 0, it must be counting down to equal 0. Consequently, N = Start / -Step.
5758 const SCEVConstant *StepC = dyn_cast<SCEVConstant>(Step);
5763 // N = -Start/Step (as unsigned)
5765 // N = Start/-Step
5766 // First compute the unsigned distance from zero in the direction of Step.
5803 getUDivExpr(Distance, CountDown ? getNegativeSCEV(Step) : Step);
5807 // If Step is a power of two that evenly divides Start we know that the loop
5814 return getUDivExactExpr(Distance, CountDown ? getNegativeSCEV(Step) : Step);
6605 const SCEV *ScalarEvolution::computeBECount(const SCEV *Delta, const SCEV *Step,
6607 const SCEV *One = getConstant(Step->getType(), 1);
6608 Delta = Equality ? getAddExpr(Delta, Step)
6609 : getAddExpr(Delta, getMinusSCEV(Step, One));
6610 return getUDivExpr(Delta, Step);
7253 const SCEV *Step = Terms[Last];
7257 if (const SCEVMulExpr *M = dyn_cast<SCEVMulExpr>(Step)) {
7263 Step = SE.getMulExpr(Qs);
7266 Sizes.push_back(Step);
7273 SCEVDivision::divide(SE, Term, Step, &Q, &R);
7292 Sizes.push_back(Step);
7376 /// Second step of delinearization: compute the array dimensions Sizes from the
7443 /// Third step of delinearization: compute the access functions for the
7553 // First step: collect parametric terms.
7560 // Second step: find subscript sizes.
7566 // Third step: compute the access functions for each subscript.