Lines Matching refs:AddRec
856 if (const SCEVAddRecExpr *AddRec = dyn_cast<SCEVAddRecExpr>(Op)) { in getTruncateExpr() local
858 for (unsigned i = 0, e = AddRec->getNumOperands(); i != e; ++i) in getTruncateExpr()
859 Operands.push_back(getTruncateExpr(AddRec->getOperand(i), Ty)); in getTruncateExpr()
860 return getAddRecExpr(Operands, AddRec->getLoop(), SCEV::FlagAnyWrap); in getTruncateExpr()
1723 const SCEVAddRecExpr *AddRec = cast<SCEVAddRecExpr>(Ops[Idx]); in getAddExpr() local
1724 const Loop *AddRecLoop = AddRec->getLoop(); in getAddExpr()
1735 LIOps.push_back(AddRec->getStart()); in getAddExpr()
1737 SmallVector<const SCEV *, 4> AddRecOps(AddRec->op_begin(), in getAddExpr()
1738 AddRec->op_end()); in getAddExpr()
1744 Flags = AddRec->getNoWrapFlags(setFlags(Flags, SCEV::FlagNW)); in getAddExpr()
1752 if (Ops[i] == AddRec) { in getAddExpr()
1767 SmallVector<const SCEV *, 4> AddRecOps(AddRec->op_begin(), in getAddExpr()
1768 AddRec->op_end()); in getAddExpr()
1928 AddRec = dyn_cast<SCEVAddRecExpr>(Ops[1])) { in getMulExpr() local
1931 for (SCEVAddRecExpr::op_iterator I = AddRec->op_begin(), in getMulExpr()
1932 E = AddRec->op_end(); I != E; ++I) { in getMulExpr()
1935 return getAddRecExpr(Operands, AddRec->getLoop(), in getMulExpr()
1936 AddRec->getNoWrapFlags(SCEV::FlagNW)); in getMulExpr()
1978 const SCEVAddRecExpr *AddRec = cast<SCEVAddRecExpr>(Ops[Idx]); in getMulExpr() local
1979 const Loop *AddRecLoop = AddRec->getLoop(); in getMulExpr()
1991 NewOps.reserve(AddRec->getNumOperands()); in getMulExpr()
1993 for (unsigned i = 0, e = AddRec->getNumOperands(); i != e; ++i) in getMulExpr()
1994 NewOps.push_back(getMulExpr(Scale, AddRec->getOperand(i))); in getMulExpr()
2001 Flags = AddRec->getNoWrapFlags(clearFlags(Flags, SCEV::FlagNW)); in getMulExpr()
2009 if (Ops[i] == AddRec) { in getMulExpr()
2040 Type *Ty = AddRec->getType(); in getMulExpr()
2043 for (int x = 0, xe = AddRec->getNumOperands() + in getMulExpr()
2049 for (int z = std::max(y-x, y-(int)AddRec->getNumOperands()+1), in getMulExpr()
2059 const SCEV *Term1 = AddRec->getOperand(y-z); in getMulExpr()
2068 AddRec->getLoop(), in getMulExpr()
2071 Ops[Idx] = AddRec = cast<SCEVAddRecExpr>(NewAddRec); in getMulExpr()
3075 } else if (const SCEVAddRecExpr *AddRec = in createNodeForPHI() local
3082 if (AddRec->getLoop() == L && AddRec->isAffine()) { in createNodeForPHI()
3087 if (StartVal == getMinusSCEV(AddRec->getOperand(0), in createNodeForPHI()
3088 AddRec->getOperand(1))) { in createNodeForPHI()
3092 getAddRecExpr(StartVal, AddRec->getOperand(1), L, in createNodeForPHI()
3330 if (const SCEVAddRecExpr *AddRec = dyn_cast<SCEVAddRecExpr>(S)) { in getUnsignedRange() local
3333 if (AddRec->getNoWrapFlags(SCEV::FlagNUW)) in getUnsignedRange()
3334 if (const SCEVConstant *C = dyn_cast<SCEVConstant>(AddRec->getStart())) in getUnsignedRange()
3341 if (AddRec->isAffine()) { in getUnsignedRange()
3342 Type *Ty = AddRec->getType(); in getUnsignedRange()
3343 const SCEV *MaxBECount = getMaxBackedgeTakenCount(AddRec->getLoop()); in getUnsignedRange()
3348 const SCEV *Start = AddRec->getStart(); in getUnsignedRange()
3349 const SCEV *Step = AddRec->getStepRecurrence(*this); in getUnsignedRange()
3367 return setUnsignedRange(AddRec, ConservativeResult); in getUnsignedRange()
3374 return setUnsignedRange(AddRec, ConservativeResult); in getUnsignedRange()
3375 return setUnsignedRange(AddRec, in getUnsignedRange()
3380 return setUnsignedRange(AddRec, ConservativeResult); in getUnsignedRange()
3472 if (const SCEVAddRecExpr *AddRec = dyn_cast<SCEVAddRecExpr>(S)) { in getSignedRange() local
3475 if (AddRec->getNoWrapFlags(SCEV::FlagNSW)) { in getSignedRange()
3478 for (unsigned i = 0, e = AddRec->getNumOperands(); i != e; ++i) { in getSignedRange()
3479 if (!isKnownNonNegative(AddRec->getOperand(i))) AllNonNeg = false; in getSignedRange()
3480 if (!isKnownNonPositive(AddRec->getOperand(i))) AllNonPos = false; in getSignedRange()
3493 if (AddRec->isAffine()) { in getSignedRange()
3494 Type *Ty = AddRec->getType(); in getSignedRange()
3495 const SCEV *MaxBECount = getMaxBackedgeTakenCount(AddRec->getLoop()); in getSignedRange()
3500 const SCEV *Start = AddRec->getStart(); in getSignedRange()
3501 const SCEV *Step = AddRec->getStepRecurrence(*this); in getSignedRange()
3519 return setSignedRange(AddRec, ConservativeResult); in getSignedRange()
3526 return setSignedRange(AddRec, ConservativeResult); in getSignedRange()
3527 return setSignedRange(AddRec, in getSignedRange()
3532 return setSignedRange(AddRec, ConservativeResult); in getSignedRange()
4473 if (const SCEVAddRecExpr *AddRec = dyn_cast<SCEVAddRecExpr>(LHS)) in ComputeExitLimitFromICmp() local
4474 if (AddRec->getLoop() == L) { in ComputeExitLimitFromICmp()
4479 const SCEV *Ret = AddRec->getNumIterationsInRange(CompRange, *this); in ComputeExitLimitFromICmp()
4533 EvaluateConstantChrecAtConstant(const SCEVAddRecExpr *AddRec, ConstantInt *C, in EvaluateConstantChrecAtConstant() argument
4536 const SCEV *Val = AddRec->evaluateAtIteration(InVal, SE); in EvaluateConstantChrecAtConstant()
5050 if (const SCEVAddRecExpr *AddRec = dyn_cast<SCEVAddRecExpr>(V)) { in computeSCEVAtScope() local
5054 for (unsigned i = 0, e = AddRec->getNumOperands(); i != e; ++i) { in computeSCEVAtScope()
5055 const SCEV *OpAtScope = getSCEVAtScope(AddRec->getOperand(i), L); in computeSCEVAtScope()
5056 if (OpAtScope == AddRec->getOperand(i)) in computeSCEVAtScope()
5061 SmallVector<const SCEV *, 8> NewOps(AddRec->op_begin(), in computeSCEVAtScope()
5062 AddRec->op_begin()+i); in computeSCEVAtScope()
5065 NewOps.push_back(getSCEVAtScope(AddRec->getOperand(i), L)); in computeSCEVAtScope()
5068 getAddRecExpr(NewOps, AddRec->getLoop(), in computeSCEVAtScope()
5069 AddRec->getNoWrapFlags(SCEV::FlagNW)); in computeSCEVAtScope()
5070 AddRec = dyn_cast<SCEVAddRecExpr>(FoldedRec); in computeSCEVAtScope()
5074 if (!AddRec) in computeSCEVAtScope()
5081 if (!AddRec->getLoop()->contains(L)) { in computeSCEVAtScope()
5084 const SCEV *BackedgeTakenCount = getBackedgeTakenCount(AddRec->getLoop()); in computeSCEVAtScope()
5085 if (BackedgeTakenCount == getCouldNotCompute()) return AddRec; in computeSCEVAtScope()
5088 return AddRec->evaluateAtIteration(BackedgeTakenCount, *this); in computeSCEVAtScope()
5091 return AddRec; in computeSCEVAtScope()
5178 SolveQuadraticEquation(const SCEVAddRecExpr *AddRec, ScalarEvolution &SE) { in SolveQuadraticEquation() argument
5179 assert(AddRec->getNumOperands() == 3 && "This is not a quadratic chrec!"); in SolveQuadraticEquation()
5180 const SCEVConstant *LC = dyn_cast<SCEVConstant>(AddRec->getOperand(0)); in SolveQuadraticEquation()
5181 const SCEVConstant *MC = dyn_cast<SCEVConstant>(AddRec->getOperand(1)); in SolveQuadraticEquation()
5182 const SCEVConstant *NC = dyn_cast<SCEVConstant>(AddRec->getOperand(2)); in SolveQuadraticEquation()
5254 const SCEVAddRecExpr *AddRec = dyn_cast<SCEVAddRecExpr>(V); in HowFarToZero() local
5255 if (!AddRec || AddRec->getLoop() != L) in HowFarToZero()
5260 if (AddRec->isQuadratic() && AddRec->getType()->isIntegerTy()) { in HowFarToZero()
5262 SolveQuadraticEquation(AddRec, *this); in HowFarToZero()
5281 const SCEV *Val = AddRec->evaluateAtIteration(R1, *this); in HowFarToZero()
5290 if (!AddRec->isAffine()) in HowFarToZero()
5305 const SCEV *Start = getSCEVAtScope(AddRec->getStart(), L->getParentLoop()); in HowFarToZero()
5306 const SCEV *Step = getSCEVAtScope(AddRec->getOperand(1), L->getParentLoop()); in HowFarToZero()
5353 if (AddRec->getNoWrapFlags(SCEV::FlagNW)) in HowFarToZero()
6087 const SCEVAddRecExpr *AddRec = dyn_cast<SCEVAddRecExpr>(LHS); in HowManyLessThans() local
6088 if (!AddRec || AddRec->getLoop() != L) in HowManyLessThans()
6092 bool NoWrap = isSigned ? AddRec->getNoWrapFlags(SCEV::FlagNSW) : in HowManyLessThans()
6093 AddRec->getNoWrapFlags(SCEV::FlagNUW); in HowManyLessThans()
6095 if (AddRec->isAffine()) { in HowManyLessThans()
6096 unsigned BitWidth = getTypeSizeInBits(AddRec->getType()); in HowManyLessThans()
6097 const SCEV *Step = AddRec->getStepRecurrence(*this); in HowManyLessThans()
6133 const SCEV *Start = AddRec->getOperand(0); in HowManyLessThans()