[llvm] [LAA][NFCI] Re-use hasComputableBounds in findForkedPointer and refactor createCheckForAccess (PR #112571)

Sergey Kachkov via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 29 02:20:59 PDT 2024


================
@@ -1039,13 +1040,10 @@ findForkedPointer(PredicatedScalarEvolution &PSE,
   SmallVector<PointerIntPair<const SCEV *, 1, bool>> Scevs;
   findForkedSCEVs(SE, L, Ptr, Scevs, MaxForkedSCEVDepth);
 
-  // For now, we will only accept a forked pointer with two possible SCEVs
-  // that are either SCEVAddRecExprs or loop invariant.
+  // For now, we will only accept a forked pointer with two possible SCEVs.
   if (Scevs.size() == 2 &&
-      (isa<SCEVAddRecExpr>(get<0>(Scevs[0])) ||
-       SE->isLoopInvariant(get<0>(Scevs[0]), L)) &&
-      (isa<SCEVAddRecExpr>(get<0>(Scevs[1])) ||
-       SE->isLoopInvariant(get<0>(Scevs[1]), L))) {
+      hasComputableBounds(PSE, Ptr, get<0>(Scevs[0]), L, /*Assume*/ false) &&
+      hasComputableBounds(PSE, Ptr, get<0>(Scevs[1]), L, /*Assume*/ false)) {
----------------
skachkov-sc wrote:

Gentle ping

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


More information about the llvm-commits mailing list