Lines Matching refs:SCEV
253 SCEV::NoWrapFlags Flags, bool IsSafeToHoist) { in InsertBinop()
276 if (I->hasNoSignedWrap() != (Flags & SCEV::FlagNSW)) in InsertBinop()
278 if (I->hasNoUnsignedWrap() != (Flags & SCEV::FlagNUW)) in InsertBinop()
315 if (Flags & SCEV::FlagNUW) in InsertBinop()
317 if (Flags & SCEV::FlagNSW) in InsertBinop()
350 Value *SCEVExpander::expandAddToGEP(const SCEV *Offset, Value *V) { in expandAddToGEP()
415 const Loop *SCEVExpander::getRelevantLoop(const SCEV *S) { in getRelevantLoop()
441 for (const SCEV *Op : S->operands()) in getRelevantLoop()
466 bool operator()(std::pair<const Loop *, const SCEV *> LHS, in operator ()()
467 std::pair<const Loop *, const SCEV *> RHS) const { in operator ()()
495 const SCEV *URemLHS = nullptr; in visitAddExpr()
496 const SCEV *URemRHS = nullptr; in visitAddExpr()
500 return InsertBinop(Instruction::URem, LHS, RHS, SCEV::FlagAnyWrap, in visitAddExpr()
508 SmallVector<std::pair<const Loop *, const SCEV *>, 8> OpsAndLoops; in visitAddExpr()
509 for (const SCEV *Op : reverse(S->operands())) in visitAddExpr()
521 const SCEV *Op = I->second; in visitAddExpr()
533 SmallVector<const SCEV *, 4> NewOps; in visitAddExpr()
537 const SCEV *X = I->second; in visitAddExpr()
547 Sum = InsertBinop(Instruction::Sub, Sum, W, SCEV::FlagAnyWrap, in visitAddExpr()
570 SmallVector<std::pair<const Loop *, const SCEV *>, 8> OpsAndLoops; in visitMulExpr()
571 for (const SCEV *Op : reverse(S->operands())) in visitMulExpr()
608 P = InsertBinop(Instruction::Mul, P, P, SCEV::FlagAnyWrap, in visitMulExpr()
612 SCEV::FlagAnyWrap, in visitMulExpr()
629 SCEV::FlagAnyWrap, /*IsSafeToHoist*/ true); in visitMulExpr()
643 NWFlags = ScalarEvolution::clearFlags(NWFlags, SCEV::FlagNSW); in visitMulExpr()
664 SCEV::FlagAnyWrap, /*IsSafeToHoist*/ true); in visitUDivExpr()
668 return InsertBinop(Instruction::UDiv, LHS, RHS, SCEV::FlagAnyWrap, in visitUDivExpr()
782 ScalarEvolution::maskFlags(*Flags, SCEV::FlagNUW) == SCEV::FlagNUW); in hoistIVInc()
784 ScalarEvolution::maskFlags(*Flags, SCEV::FlagNSW) == SCEV::FlagNSW); in hoistIVInc()
908 const SCEV *Step = AR->getStepRecurrence(SE); in IsIncrementNSW()
909 const SCEV *OpAfterExtend = SE.getAddExpr(SE.getSignExtendExpr(Step, WideTy), in IsIncrementNSW()
911 const SCEV *ExtendAfterOp = in IsIncrementNSW()
922 const SCEV *Step = AR->getStepRecurrence(SE); in IsIncrementNUW()
923 const SCEV *OpAfterExtend = SE.getAddExpr(SE.getZeroExtendExpr(Step, WideTy), in IsIncrementNUW()
925 const SCEV *ExtendAfterOp = in IsIncrementNUW()
1053 const SCEV *Step = Normalized->getStepRecurrence(SE); in getAddRecExprPHILiterally()
1125 [[maybe_unused]] const SCEV *Start = Normalized->getStart(); in expandAddRecExprLiterally()
1126 const SCEV *Step = Normalized->getStepRecurrence(SE); in expandAddRecExprLiterally()
1230 SmallVector<const SCEV *, 4> NewOps(S->getNumOperands()); in visitAddRecExpr()
1234 S->getNoWrapFlags(SCEV::FlagNW))); in visitAddRecExpr()
1248 SmallVector<const SCEV *, 4> NewOps(S->operands()); in visitAddRecExpr()
1250 const SCEV *Rest = SE.getAddRecExpr(NewOps, L, in visitAddRecExpr()
1251 S->getNoWrapFlags(SCEV::FlagNW)); in visitAddRecExpr()
1257 const SCEV *AddExprLHS = SE.getUnknown(expand(S->getStart())); in visitAddRecExpr()
1258 const SCEV *AddExprRHS = SE.getUnknown(expand(Rest)); in visitAddRecExpr()
1321 const SCEV *IH = SE.getUnknown(CanonicalIV); // Get I as a "symbolic" SCEV. in visitAddRecExpr()
1324 const SCEV *NewS = S; in visitAddRecExpr()
1325 const SCEV *Ext = SE.getNoopOrAnyExtend(S, CanonicalIV->getType()); in visitAddRecExpr()
1329 const SCEV *V = cast<SCEVAddRecExpr>(NewS)->evaluateAtIteration(IH, SE); in visitAddRecExpr()
1332 const SCEV *T = SE.getTruncateOrNoop(V, Ty); in visitAddRecExpr()
1407 Value *SCEVExpander::expandCodeFor(const SCEV *SH, Type *Ty, in expandCodeFor()
1414 Value *SCEVExpander::expandCodeFor(const SCEV *SH, Type *Ty) { in expandCodeFor()
1427 const SCEV *S, const Instruction *InsertPt, in FindValueInExprValueMap()
1466 Value *SCEVExpander::expand(const SCEV *S) { in expand()
1473 auto SafeToHoist = [](const SCEV *S) { in expand()
1474 return !SCEVExprContains(S, [](const SCEV *S) { in expand()
1542 ScalarEvolution::maskFlags(*Flags, SCEV::FlagNUW) == SCEV::FlagNUW); in expand()
1544 ScalarEvolution::maskFlags(*Flags, SCEV::FlagNSW) == SCEV::FlagNSW); in expand()
1615 const SCEV *TruncExpr = in replaceCongruentIVInc()
1695 DenseMap<const SCEV *, PHINode *> ExprToIVMap; in replaceCongruentIVs()
1736 const SCEV *PhiExpr = SE.getSCEV(Phi); in replaceCongruentIVs()
1740 const SCEV *TruncExpr = in replaceCongruentIVs()
1773 bool SCEVExpander::hasRelatedExistingExpansion(const SCEV *S, in hasRelatedExistingExpansion()
1916 int NumTerms = llvm::count_if(S->operands(), [](const SCEV *Op) { in costAndCollectOperands()
1926 llvm::count_if(S->operands(), [](const SCEV *Op) { in costAndCollectOperands()
1969 SmallPtrSetImpl<const SCEV *> &Processed, in isHighCostExpansionHelper()
1974 const SCEV *S = WorkItem.S; in isHighCostExpansionHelper()
2091 const SCEV *ExitCount = in generateOverflowCheck()
2096 const SCEV *Step = AR->getStepRecurrence(SE); in generateOverflowCheck()
2097 const SCEV *Start = AR->getStart(); in generateOverflowCheck()
2322 bool follow(const SCEV *S) { in follow()
2344 bool SCEVExpander::isSafeToExpand(const SCEV *S) const { in isSafeToExpand()
2350 bool SCEVExpander::isSafeToExpandAt(const SCEV *S, in isSafeToExpandAt()