[llvm-branch-commits] [llvm] [VPlan] Implement VPlan-based unit-strideness speculation (PR #182595)

Ramkumar Ramachandra via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Fri Jul 17 11:56:24 PDT 2026


================
@@ -5801,23 +5806,30 @@ void VPlanTransforms::expandSCEVsToVPInstructions(VPlan &Plan,
                     ->getDebugLoc();
   VPSCEVExpander Expander(Builder, SE, DL);
 
-  // Expand VPExpandSCEVRecipes to VPInstructions using VPSCEVExpander. During
-  // the transition, unsupported VPExpandSCEVRecipes are skipped and left for
-  // late expansion.
+  // Expand VPExpandSCEVRecipes and VPExpandStridePredicatesRecipes to
+  // VPInstructions using VPSCEVExpander. During the transition, unsupported
+  // recipes are skipped and left for late expansion.
   for (VPRecipeBase &R : make_early_inc_range(*Entry)) {
-    auto *ExpSCEV = dyn_cast<VPExpandSCEVRecipe>(&R);
-    if (!ExpSCEV || ExpSCEV->user_empty())
+    auto *Def = dyn_cast<VPSingleDefRecipe>(&R);
+    if (!Def || Def->user_empty())
+      continue;
----------------
artagnon wrote:

```suggestion
    if (!isa<VPExpandStridePredicatesRecipe, VPExpandSCEVRecipe>(&R) || R.user_empty())
      continue;
```

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


More information about the llvm-branch-commits mailing list