[llvm] [VPlan] Connect (MemRuntime|SCEV)Check blocks as VPlan transform (NFC). (PR #143879)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Sat Jul 5 14:04:43 PDT 2025


================
@@ -7402,6 +7308,12 @@ DenseMap<const SCEV *, Value *> LoopVectorizationPlanner::executePlan(
       ILV.getOrCreateVectorTripCount(ILV.LoopVectorPreHeader), State);
   replaceVPBBWithIRVPBB(VectorPH, State.CFG.PrevBB);
 
+  // Move check blocks to their final position.
+  if (BasicBlock *MemCheckBlock = ILV.RTChecks.getMemCheckBlock())
+    MemCheckBlock->moveAfter(EntryBB);
+  if (BasicBlock *SCEVCheckBlock = ILV.RTChecks.getSCEVCheckBlock())
+    SCEVCheckBlock->moveAfter(EntryBB);
+
----------------
fhahn wrote:

The control-flow is completely modeled in VPlan. This is just the position in the function, added a TODO

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


More information about the llvm-commits mailing list