[llvm] [LV] Check Addr in getAddressAccessSCEV in terms of SCEV expressions. (PR #171204)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 15 00:35:04 PST 2025


================
@@ -3123,15 +3124,11 @@ static const SCEV *getAddressAccessSCEV(const VPValue *Ptr, ScalarEvolution &SE,
                  match(Ptr, m_GetElementPtr(m_VPValue(), m_VPValue()))))
     return nullptr;
 
-  // We are looking for a GEP where all indices are either loop invariant or
-  // inductions.
-  for (VPValue *Opd : drop_begin(PtrR->operands())) {
-    if (!Opd->isDefinedOutsideLoopRegions() &&
-        !isa<VPScalarIVStepsRecipe, VPWidenIntOrFpInductionRecipe>(Opd))
-      return nullptr;
-  }
+  const SCEV *Addr = vputils::getSCEVExprForVPValue(Ptr, SE, L);
+  if (isa<SCEVCouldNotCompute>(Addr))
----------------
fhahn wrote:

I'm not sure, I think the legacy version should never return SCEVCouldNotCompute. `getSCEVExprForVPValue` is still a bit special in that regard, as it does not support constructing SCEVs for all types of recipes yet

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


More information about the llvm-commits mailing list