[llvm] [VPlan] Move initial skeleton construction earlier (NFC). (PR #150848)

via llvm-commits llvm-commits at lists.llvm.org
Sun Aug 3 09:27:10 PDT 2025


================
@@ -8945,10 +8947,14 @@ VPlanPtr LoopVectorizationPlanner::tryToBuildVPlan(VFRange &Range) {
   assert(EnableVPlanNativePath && "VPlan-native path is not enabled.");
 
   auto Plan = VPlanTransforms::buildPlainCFG(OrigLoop, *LI);
-  VPlanTransforms::prepareForVectorization(
-      *Plan, Legal->getWidestInductionType(), PSE, true, false, OrigLoop,
-      getDebugLocFromInstOrOperands(Legal->getPrimaryInduction()), false,
-      Range);
+
----------------
ayalz wrote:

```suggestion
```

Should `buildPlainCFG()` be called `buildPlainLoopCFG()` or buildPlainCFGForLoop()`, as it focuses on building the basic blocks of the loop along with its preheader and exit. `buildInitialSkeleton()` also builds plain CFG, can be called `connectPlainLoopCFG()`, as it adds new basic blocks before and after the loop connecting it(?). Should a new `buildSkeletalPlan()` call `buildPlainCFG()` followed by `addInitialSkeleton()`? Together they build an initial CFG-based skeleton of VPlan.

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


More information about the llvm-commits mailing list