[llvm] [LAA] Rewrite findForkedPointer, fixing freeze (PR #140298)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Sun May 18 13:10:52 PDT 2025


================
@@ -1088,29 +1092,49 @@ static void findForkedSCEVs(
   }
 }
 
-static SmallVector<PointerIntPair<const SCEV *, 1, bool>>
-findForkedPointer(PredicatedScalarEvolution &PSE,
-                  const DenseMap<Value *, const SCEV *> &StridesMap, Value *Ptr,
-                  const Loop *L) {
-  ScalarEvolution *SE = PSE.getSE();
-  assert(SE->isSCEVable(Ptr->getType()) && "Value is not SCEVable!");
-  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.
-  if (Scevs.size() == 2 &&
----------------
fhahn wrote:

Does the patch strip the requirement for at most 2 forked SCEVs? 

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


More information about the llvm-commits mailing list