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

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Tue May 21 03:00:08 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
----------------
fhahn wrote:

dropped, thanks!

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


More information about the llvm-commits mailing list