[llvm] [VPlan] Construct VPlan1 once, share across buildVPlans calls. (PR #197276)

via llvm-commits llvm-commits at lists.llvm.org
Sat May 23 13:15:04 PDT 2026


================
@@ -5614,12 +5614,17 @@ void LoopVectorizationPlanner::plan(ElementCount UserVF, unsigned UserIC) {
   if (!MaxFactors) // Cases that should not to be vectorized nor interleaved.
     return;
 
+  Config.collectInLoopReductions();
+
   if (!OrigLoop->isInnermost()) {
     // For outer loops, computeMaxVF returns a single non-scalar VF; build a
-    // plan for only that VF.
+    // plan for that VF only.
+    auto VPlan1 = tryToBuildVPlan1();
+    if (!VPlan1)
+      return;
----------------
ayalz wrote:

Predicates for consecutive accesses are not added (yet) to outer-loop vectorization, but better factor that into allowRuntimeSCEVChecks(), or under collectUnitStridePredicates() - see below.

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


More information about the llvm-commits mailing list