[llvm] [DA] Check monotonicity for subscripts (PR #154527)

Michael Kruse via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 22 03:28:11 PDT 2025


================
@@ -3548,6 +3560,102 @@ SCEVUnionPredicate DependenceInfo::getRuntimeAssumptions() const {
   return SCEVUnionPredicate(Assumptions, *SE);
 }
 
+bool DependenceInfo::isMonotonicSCEV(const SCEV *Expr, const SCEV *&Min,
+                                     const SCEV *&Max, ScalarEvolution *SE,
+                                     const Loop *OutermostLoop, IntegerType *Ty,
+                                     const Value *Ptr) const {
+  const SCEVAddRecExpr *AddRec = dyn_cast<SCEVAddRecExpr>(Expr);
----------------
Meinersbur wrote:

Consider using the `SCEVVisitor` pattern. It was made for such uses.

https://github.com/llvm/llvm-project/pull/154527


More information about the llvm-commits mailing list