[llvm] [VPlan] Unify inner and outer loop paths (NFCI). (PR #192868)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 30 03:36:14 PDT 2026


================
@@ -6999,9 +7003,21 @@ void LoopVectorizationPlanner::buildVPlansWithVPRecipes(ElementCount MinVF,
   }
 }
 
-VPlanPtr
-LoopVectorizationPlanner::tryToBuildVPlanWithVPRecipes(VPlanPtr Plan,
-                                                       VFRange &Range) {
+VPlanPtr LoopVectorizationPlanner::tryToBuildVPlan(VPlanPtr Plan,
+                                                   VFRange &Range) {
+
+  // For outer loops, the plan only needs basic recipe conversion and induction
+  // live-out optimization; the full inner-loop recipe building below does not
+  // apply (no widening decisions, interleave groups, reductions, etc.).
+  if (!OrigLoop->isInnermost()) {
+    for (ElementCount VF : Range)
+      Plan->addVF(VF);
+    if (!VPlanTransforms::tryToConvertVPInstructionsToVPRecipes(*Plan, *TLI))
----------------
fhahn wrote:

Yep

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


More information about the llvm-commits mailing list