[llvm] [VPlan] Manage created blocks directly in VPlan. (NFC) (PR #120918)

via llvm-commits llvm-commits at lists.llvm.org
Sun Dec 29 14:26:14 PST 2024


================
@@ -2477,7 +2477,7 @@ static void introduceCheckBlockInVPlan(VPlan &Plan, BasicBlock *CheckIRBB) {
     assert(PreVectorPH->getNumSuccessors() == 2 && "Expected 2 successors");
     assert(PreVectorPH->getSuccessors()[0] == ScalarPH &&
            "Unexpected successor");
-    VPIRBasicBlock *CheckVPIRBB = VPIRBasicBlock::fromBasicBlock(CheckIRBB);
+    VPIRBasicBlock *CheckVPIRBB = Plan.createVPIRBasicBlock(CheckIRBB);
----------------
ayalz wrote:

This thought can be pursued as follow-up.

A builder can be initialized with VPlan. The builder would provide an API for creating blocks (including but not limited to), whose implementation registers the new block within VPlan. Would be good to create VPlan components consistently, rather than having the abovementioned four distinct mechanisms.

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


More information about the llvm-commits mailing list