@@ -857,7 +857,7 @@ static bool hasHugeExpression(ArrayRef<SCEVUse> Ops) {
857857template <typename FoldT, typename IsIdentityT, typename IsAbsorberT>
858858static const SCEV *
859859constantFoldAndGroupOps(ScalarEvolution &SE, LoopInfo &LI, DominatorTree &DT,
860- SmallVectorImpl<const SCEV * > &Ops, FoldT Fold,
860+ SmallVectorImpl<SCEVUse > &Ops, FoldT Fold,
861861 IsIdentityT IsIdentity, IsAbsorberT IsAbsorber) {
862862 const SCEVConstant *Folded = nullptr;
863863 for (unsigned Idx = 0; Idx < Ops.size();) {
@@ -2263,12 +2263,12 @@ SCEVUse ScalarEvolution::getAnyExtendExpr(SCEVUse Op, Type *Ty) {
22632263/// may be exposed. This helps getAddRecExpr short-circuit extra work in
22642264/// the common case where no interesting opportunities are present, and
22652265/// is also used as a check to avoid infinite recursion.
2266- static bool
2267- CollectAddOperandsWithScales(SmallDenseMap<const SCEV *, APInt, 16 > &M ,
2268- SmallVectorImpl<SCEVUse> &NewOps ,
2269- APInt &AccumulatedConstant ,
2270- ArrayRef<SCEVUse> Ops, const APInt &Scale,
2271- ScalarEvolution &SE) {
2266+ static bool CollectAddOperandsWithScales(SmallDenseMap<SCEVUse, APInt, 16> &M,
2267+ SmallVectorImpl<SCEVUse > &NewOps ,
2268+ APInt &AccumulatedConstant ,
2269+ ArrayRef<SCEVUse> Ops ,
2270+ const APInt &Scale,
2271+ ScalarEvolution &SE) {
22722272 bool Interesting = false;
22732273
22742274 // Iterate over the add operands. They are sorted, with constants first.
@@ -8208,7 +8208,7 @@ ScalarEvolution::getSmallConstantTripCount(const Loop *L,
82088208unsigned ScalarEvolution::getSmallConstantMaxTripCount(
82098209 const Loop *L, SmallVectorImpl<const SCEVPredicate *> *Predicates) {
82108210
8211- const auto * MaxExitCount =
8211+ SCEVUse MaxExitCount =
82128212 Predicates ? getPredicatedConstantMaxBackedgeTakenCount(L, *Predicates)
82138213 : getConstantMaxBackedgeTakenCount(L);
82148214 return getConstantTripCount(dyn_cast<SCEVConstant>(MaxExitCount));
@@ -8315,12 +8315,12 @@ SCEVUse ScalarEvolution::getBackedgeTakenCount(const Loop *L,
83158315 llvm_unreachable("Invalid ExitCountKind!");
83168316}
83178317
8318- const SCEV * ScalarEvolution::getPredicatedSymbolicMaxBackedgeTakenCount(
8318+ SCEVUse ScalarEvolution::getPredicatedSymbolicMaxBackedgeTakenCount(
83198319 const Loop *L, SmallVectorImpl<const SCEVPredicate *> &Preds) {
83208320 return getPredicatedBackedgeTakenInfo(L).getSymbolicMax(L, this, &Preds);
83218321}
83228322
8323- const SCEV * ScalarEvolution::getPredicatedConstantMaxBackedgeTakenCount(
8323+ SCEVUse ScalarEvolution::getPredicatedConstantMaxBackedgeTakenCount(
83248324 const Loop *L, SmallVectorImpl<const SCEVPredicate *> &Preds) {
83258325 return getPredicatedBackedgeTakenInfo(L).getConstantMax(this, &Preds);
83268326}
@@ -9221,7 +9221,7 @@ ScalarEvolution::ExitLimit ScalarEvolution::computeExitLimitFromICmp(
92219221 isKnownPositive(AR->getStepRecurrence(*this))) {
92229222 auto Flags = AR->getNoWrapFlags();
92239223 Flags = setFlags(Flags, WrapType);
9224- SmallVector<const SCEV* > Operands{AR->operands()};
9224+ SmallVector<SCEVUse > Operands{AR->operands()};
92259225 Flags = StrengthenNoWrapFlags(this, scAddRecExpr, Operands, Flags);
92269226 setNoWrapFlags(const_cast<SCEVAddRecExpr *>(AR), Flags);
92279227 }
@@ -13783,7 +13783,7 @@ static void PrintLoopInfo(raw_ostream &OS, ScalarEvolution *SE,
1378313783 }
1378413784 Preds.clear();
1378513785
13786- auto * PredConstantMax =
13786+ auto PredConstantMax =
1378713787 SE->getPredicatedConstantMaxBackedgeTakenCount(L, Preds);
1378813788 if (PredConstantMax != ConstantBTC) {
1378913789 assert(!Preds.empty() &&
@@ -13803,7 +13803,7 @@ static void PrintLoopInfo(raw_ostream &OS, ScalarEvolution *SE,
1380313803 }
1380413804 Preds.clear();
1380513805
13806- auto * PredSymbolicMax =
13806+ auto PredSymbolicMax =
1380713807 SE->getPredicatedSymbolicMaxBackedgeTakenCount(L, Preds);
1380813808 if (SymbolicBTC != PredSymbolicMax) {
1380913809 assert(!Preds.empty() &&
0 commit comments