[llvm] [LAA] Check accesses don't overlap early to determine NoDep (PR #92307)

Michael Kruse via llvm-commits llvm-commits at lists.llvm.org
Tue May 21 02:19:11 PDT 2024


================
@@ -213,16 +213,14 @@ getStartAndEndForAccess(const Loop *Lp, const SCEV *PtrExpr, Type *AccessTy,
 
   if (SE->isLoopInvariant(PtrExpr, Lp)) {
     ScStart = ScEnd = PtrExpr;
-  } else {
-    const SCEVAddRecExpr *AR = dyn_cast<SCEVAddRecExpr>(PtrExpr);
-    assert(AR && "Invalid addrec expression");
+  } else if (auto *AR = dyn_cast<SCEVAddRecExpr>(PtrExpr)) {
     const SCEV *Ex = PSE.getBackedgeTakenCount();
 
     ScStart = AR->getStart();
     ScEnd = AR->evaluateAtIteration(Ex, *SE);
     const SCEV *Step = AR->getStepRecurrence(*SE);
 
-    // For expressions with negative step, the upper bound is ScStart and the
+    // For expressions with negative step, the& upper bound is ScStart and the
----------------
Meinersbur wrote:

[nit]

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


More information about the llvm-commits mailing list