[llvm] [VPlan] Create header phis once, after constructing VPlan0 (NFC). (PR #168291)

via llvm-commits llvm-commits at lists.llvm.org
Sat Dec 13 23:58:09 PST 2025


================
@@ -8404,6 +8315,12 @@ void LoopVectorizationPlanner::buildVPlansWithVPRecipes(ElementCount MinVF,
       OrigLoop, *LI, Legal->getWidestInductionType(),
       getDebugLocFromInstOrOperands(Legal->getPrimaryInduction()), PSE, &LVer);
 
+  // Create recipes for header phis.
+  VPlanTransforms::createHeaderPhiRecipes(
+      *VPlan0, *PSE.getSE(), *OrigLoop, Legal->getInductionVars(),
+      Legal->getReductionVars(), Legal->getFixedOrderRecurrences(),
+      CM.getInLoopReductions(), Hints.allowReordering());
+
----------------
ayalz wrote:

Should createHeaderPhiRecipes() be part of buildVPlan0()? This would admittedly require passing the former's parameters to the latter.

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


More information about the llvm-commits mailing list