[llvm] [VPlan] Retain exit conditions and edges in initial VPlan (NFC). (PR #137709)
David Sherwood via llvm-commits
llvm-commits at lists.llvm.org
Wed May 7 05:55:09 PDT 2025
================
@@ -491,12 +481,33 @@ void VPlanTransforms::prepareForVectorization(VPlan &Plan, Type *InductionTy,
VPBlockUtils::insertBlockAfter(VecPreheader, Plan.getEntry());
VPBasicBlock *MiddleVPBB = Plan.createVPBasicBlock("middle.block");
- VPBlockUtils::connectBlocks(LatchVPB, MiddleVPBB);
- LatchVPB->swapSuccessors();
+ // Canonical LatchVPB has header block as last successor. If it has another
+ // successor, the latter is an exit block - insert middle block on its edge.
----------------
david-arm wrote:
Sorry, I'm a bit confused by the word "latter" here. Does "latter" refer to "another successor"? Perhaps it's easier just to say that if the latchvpb is not canonical the early exit block(s) come first, with the (canonical?) exit to the middle block being last? If I've understood the layout correctly.
https://github.com/llvm/llvm-project/pull/137709
More information about the llvm-commits
mailing list