[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


================
@@ -474,6 +469,16 @@ void VPIRBasicBlock::execute(VPTransformState *State) {
   connectToPredecessors(State->CFG);
 }
 
+VPIRBasicBlock *VPIRBasicBlock::clone() {
+  auto *NewBlock = getPlan()->createVPIRBasicBlock(IRBB);
+  for (VPRecipeBase &R : make_early_inc_range(*NewBlock))
+    R.eraseFromParent();
----------------
ayalz wrote:

```suggestion
  for (VPRecipeBase &NewR : make_early_inc_range(*NewBlock))
    NewR.eraseFromParent();
```

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


More information about the llvm-commits mailing list