Lines Matching refs:SCEV

214                                  SCEV::NoWrapFlags Flags, bool IsSafeToHoist) {  in InsertBinop()
237 if (I->hasNoSignedWrap() != (Flags & SCEV::FlagNSW)) in InsertBinop()
239 if (I->hasNoUnsignedWrap() != (Flags & SCEV::FlagNUW)) in InsertBinop()
276 if (Flags & SCEV::FlagNUW) in InsertBinop()
278 if (Flags & SCEV::FlagNSW) in InsertBinop()
311 Value *SCEVExpander::expandAddToGEP(const SCEV *Offset, Value *V) { in expandAddToGEP()
376 const Loop *SCEVExpander::getRelevantLoop(const SCEV *S) { in getRelevantLoop()
402 for (const SCEV *Op : S->operands()) in getRelevantLoop()
427 bool operator()(std::pair<const Loop *, const SCEV *> LHS, in operator ()()
428 std::pair<const Loop *, const SCEV *> RHS) const { in operator ()()
459 SmallVector<std::pair<const Loop *, const SCEV *>, 8> OpsAndLoops; in visitAddExpr()
460 for (const SCEV *Op : reverse(S->operands())) in visitAddExpr()
472 const SCEV *Op = I->second; in visitAddExpr()
484 SmallVector<const SCEV *, 4> NewOps; in visitAddExpr()
488 const SCEV *X = I->second; in visitAddExpr()
498 Sum = InsertBinop(Instruction::Sub, Sum, W, SCEV::FlagAnyWrap, in visitAddExpr()
521 SmallVector<std::pair<const Loop *, const SCEV *>, 8> OpsAndLoops; in visitMulExpr()
522 for (const SCEV *Op : reverse(S->operands())) in visitMulExpr()
559 P = InsertBinop(Instruction::Mul, P, P, SCEV::FlagAnyWrap, in visitMulExpr()
563 SCEV::FlagAnyWrap, in visitMulExpr()
580 SCEV::FlagAnyWrap, /*IsSafeToHoist*/ true); in visitMulExpr()
594 NWFlags = ScalarEvolution::clearFlags(NWFlags, SCEV::FlagNSW); in visitMulExpr()
615 SCEV::FlagAnyWrap, /*IsSafeToHoist*/ true); in visitUDivExpr()
619 return InsertBinop(Instruction::UDiv, LHS, RHS, SCEV::FlagAnyWrap, in visitUDivExpr()
732 ScalarEvolution::maskFlags(*Flags, SCEV::FlagNUW) == SCEV::FlagNUW); in hoistIVInc()
734 ScalarEvolution::maskFlags(*Flags, SCEV::FlagNSW) == SCEV::FlagNSW); in hoistIVInc()
848 const SCEV *Step = AR->getStepRecurrence(SE); in IsIncrementNSW()
849 const SCEV *OpAfterExtend = SE.getAddExpr(SE.getSignExtendExpr(Step, WideTy), in IsIncrementNSW()
851 const SCEV *ExtendAfterOp = in IsIncrementNSW()
862 const SCEV *Step = AR->getStepRecurrence(SE); in IsIncrementNUW()
863 const SCEV *OpAfterExtend = SE.getAddExpr(SE.getZeroExtendExpr(Step, WideTy), in IsIncrementNUW()
865 const SCEV *ExtendAfterOp = in IsIncrementNUW()
993 const SCEV *Step = Normalized->getStepRecurrence(SE); in getAddRecExprPHILiterally()
1068 [[maybe_unused]] const SCEV *Start = Normalized->getStart(); in expandAddRecExprLiterally()
1069 const SCEV *Step = Normalized->getStepRecurrence(SE); in expandAddRecExprLiterally()
1173 SmallVector<const SCEV *, 4> NewOps(S->getNumOperands()); in visitAddRecExpr()
1177 S->getNoWrapFlags(SCEV::FlagNW))); in visitAddRecExpr()
1191 SmallVector<const SCEV *, 4> NewOps(S->operands()); in visitAddRecExpr()
1193 const SCEV *Rest = SE.getAddRecExpr(NewOps, L, in visitAddRecExpr()
1194 S->getNoWrapFlags(SCEV::FlagNW)); in visitAddRecExpr()
1200 const SCEV *AddExprLHS = SE.getUnknown(expand(S->getStart())); in visitAddRecExpr()
1201 const SCEV *AddExprRHS = SE.getUnknown(expand(Rest)); in visitAddRecExpr()
1264 const SCEV *IH = SE.getUnknown(CanonicalIV); // Get I as a "symbolic" SCEV. in visitAddRecExpr()
1267 const SCEV *NewS = S; in visitAddRecExpr()
1268 const SCEV *Ext = SE.getNoopOrAnyExtend(S, CanonicalIV->getType()); in visitAddRecExpr()
1272 const SCEV *V = cast<SCEVAddRecExpr>(NewS)->evaluateAtIteration(IH, SE); in visitAddRecExpr()
1275 const SCEV *T = SE.getTruncateOrNoop(V, Ty); in visitAddRecExpr()
1350 Value *SCEVExpander::expandCodeFor(const SCEV *SH, Type *Ty, in expandCodeFor()
1357 Value *SCEVExpander::expandCodeFor(const SCEV *SH, Type *Ty) { in expandCodeFor()
1370 const SCEV *S, const Instruction *InsertPt, in FindValueInExprValueMap()
1409 Value *SCEVExpander::expand(const SCEV *S) { in expand()
1416 auto SafeToHoist = [](const SCEV *S) { in expand()
1417 return !SCEVExprContains(S, [](const SCEV *S) { in expand()
1484 ScalarEvolution::maskFlags(*Flags, SCEV::FlagNUW) == SCEV::FlagNUW); in expand()
1486 ScalarEvolution::maskFlags(*Flags, SCEV::FlagNSW) == SCEV::FlagNSW); in expand()
1544 DenseMap<const SCEV *, PHINode *> ExprToIVMap; in replaceCongruentIVs()
1585 const SCEV *PhiExpr = SE.getSCEV(Phi); in replaceCongruentIVs()
1589 const SCEV *TruncExpr = in replaceCongruentIVs()
1629 const SCEV *TruncExpr = in replaceCongruentIVs()
1675 bool SCEVExpander::hasRelatedExistingExpansion(const SCEV *S, in hasRelatedExistingExpansion()
1818 int NumTerms = llvm::count_if(S->operands(), [](const SCEV *Op) { in costAndCollectOperands()
1828 llvm::count_if(S->operands(), [](const SCEV *Op) { in costAndCollectOperands()
1871 SmallPtrSetImpl<const SCEV *> &Processed, in isHighCostExpansionHelper()
1876 const SCEV *S = WorkItem.S; in isHighCostExpansionHelper()
1993 const SCEV *ExitCount = in generateOverflowCheck()
1998 const SCEV *Step = AR->getStepRecurrence(SE); in generateOverflowCheck()
1999 const SCEV *Start = AR->getStart(); in generateOverflowCheck()
2224 bool follow(const SCEV *S) { in follow()
2246 bool SCEVExpander::isSafeToExpand(const SCEV *S) const { in isSafeToExpand()
2252 bool SCEVExpander::isSafeToExpandAt(const SCEV *S, in isSafeToExpandAt()