[llvm] [VPlan][NFC] Extract addCurrentIterationPhi from addExplicitVectorLength (PR #182650)

Luke Lau via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 25 08:00:02 PST 2026


================
@@ -802,6 +802,14 @@ const VPBasicBlock *VPBasicBlock::getCFGPredecessor(unsigned Idx) const {
   return Pred->getExitingBasicBlock();
 }
 
+VPHeaderPHIRecipe *VPRegionBlock::getCurrentIteration() {
----------------
lukel97 wrote:

> Adding VPRegionBlock::getCurrentIteration is a step toward eventually moving addExplicitVectorLength into tryToBuildVPlanWithVPRecipes.

Yup, that's my understanding of the plan as well. We'll need to start changing other transforms to use getCurrentIteration if we want to do EVL tail folding/partial alias masking earlier during vplan construction. Since for some passes it won't be correct if they start using the canonical IV again after we've replaced it with the VPCurrentIterationPHI.

> @lukel97 does that sound good?

Yup, sounds good if we want leave that to another PR



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


More information about the llvm-commits mailing list