[llvm] [VPlan] Handle early exit before forming regions. (NFC) (PR #138393)

David Sherwood via llvm-commits llvm-commits at lists.llvm.org
Fri May 9 06:15:50 PDT 2025


================
@@ -491,19 +490,35 @@ void VPlanTransforms::prepareForVectorization(VPlan &Plan, Type *InductionTy,
   addCanonicalIVRecipes(Plan, cast<VPBasicBlock>(HeaderVPB),
                         cast<VPBasicBlock>(LatchVPB), InductionTy, IVDL);
 
-  // Disconnect all edges to exit blocks other than from the middle block.
-  // TODO: VPlans with early exits should be explicitly converted to a form
-  // exiting only via the latch here, including adjusting the exit condition,
-  // instead of simply disconnecting the edges and adjusting the VPlan later.
-  for (VPBlockBase *EB : Plan.getExitBlocks()) {
----------------
david-arm wrote:

Perhaps worth replacing the old comment with a new one explaining what the loop is doing at a high level?

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


More information about the llvm-commits mailing list