[llvm] [VPlan] Account for early-exit dispatch blocks when updating LI. (PR #185618)
Luke Lau via llvm-commits
llvm-commits at lists.llvm.org
Thu Mar 12 07:29:32 PDT 2026
================
@@ -965,6 +965,32 @@ void VPlan::execute(VPTransformState *State) {
for (VPBlockBase *Block : RPOT)
Block->execute(State);
+ if (hasEarlyExit()) {
+ // Fix up LoopInfo for extra dispatch blocks when vectorizing loops with
+ // early exits. For dispatch blocks, we need to find the smallest common
+ // loop of all successors. Note: we only need to update loop info for blocks
+ // after the middle block, but there is no easy way to get those at this
+ // point.
+ for (VPBlockBase *VPB : reverse(RPOT)) {
----------------
lukel97 wrote:
I guess we could do a vp_post_order traversal but it's probably best to reuse the existing RPOT instead of recomputing it
https://github.com/llvm/llvm-project/pull/185618
More information about the llvm-commits
mailing list