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

via llvm-commits llvm-commits at lists.llvm.org
Sun Dec 29 11:54:09 PST 2024


================
@@ -29,11 +29,11 @@ TEST_F(VPDominatorTreeTest, DominanceNoRegionsTest) {
   //  }
   VPlan &Plan = getPlan();
   VPBasicBlock *VPBB0 = Plan.getEntry();
-  VPBasicBlock *VPBB1 = new VPBasicBlock("VPBB1");
-  VPBasicBlock *VPBB2 = new VPBasicBlock("VPBB2");
-  VPBasicBlock *VPBB3 = new VPBasicBlock("VPBB3");
-  VPBasicBlock *VPBB4 = new VPBasicBlock("VPBB4");
-  VPRegionBlock *R1 = new VPRegionBlock(VPBB1, VPBB4);
+  VPBasicBlock *VPBB1 = Plan.createVPBasicBlock("VPBB1");
----------------
ayalz wrote:

> Note that the original constructors taking VPBlockBase are retained at the moment for unit tests.

Which unit tests still need access to original constructors? Better move the latter from 'public' asap, and until then add a comment that VPBB's should be created (and registered) via VPlan::create*() methods, and be destroyed implicitly by VPlan's destructor,  rather than be constructed and deleted explicitly.

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


More information about the llvm-commits mailing list