[llvm] [VPlan] Migrate convertToStridedAccesses to VPSCEVExpander (PR #208939)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 13 00:49:05 PDT 2026


================
@@ -7749,7 +7749,11 @@ void VPlanTransforms::convertToStridedAccesses(VPlan &Plan,
       // Create the base pointer of strided access.
       // TODO: reuse VPDerivedIVRecipe for base pointer computation when it
       // supports a general VPValue as the start value.
-      VPValue *StartVPV = vputils::getOrCreateVPValueForSCEVExpr(Plan, Start);
+      VPValue *StartVPV =
+          VPSCEVExpander(Builder, *PSE.getSE(), LoadR->getDebugLoc())
+              .tryToExpand(Start);
+      if (!StartVPV)
+        continue;
----------------
fhahn wrote:

Do we have a test case for an expression we cannot expand here? If there are such cases, we should still create the VPExpandSCEVRecipe, otherwise we would miss out on optimization?

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


More information about the llvm-commits mailing list