[llvm] [VPlan] Model middle block via VPIRBasicBlock. (PR #95816)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 20 02:24:34 PDT 2024


================
@@ -842,6 +842,18 @@ void VPlan::prepareToExecute(Value *TripCountV, Value *VectorTripCountV,
   }
 }
 
+/// Replace \p VPBB with a VPIRBasicBlock wrapping \p IRBB. All recipes from \p
+/// VPBB are moved to the newly created VPIRBasicBlock.
+static void replaceVPBBWithIRVPBB(VPBasicBlock *VPBB, BasicBlock *IRBB) {
+  VPIRBasicBlock *IRMiddleVPBB = new VPIRBasicBlock(IRBB);
+  for (auto &R : make_early_inc_range(*VPBB))
+    R.moveBefore(*IRMiddleVPBB, IRMiddleVPBB->end());
+  VPBlockBase *PredVPBB = VPBB->getSinglePredecessor();
----------------
fhahn wrote:

For now yes , added an assert for successors; the next patch will relax this further.

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


More information about the llvm-commits mailing list