================
@@ -614,6 +614,61 @@ void VPBasicBlock::print(raw_ostream &O, const Twine 
&Indent,
   printSuccessors(O, Indent);
 }
 #endif
+static void cloneCFG(VPBlockBase *Entry,
+                     DenseMap<VPBlockBase *, VPBlockBase *> &Old2NewVPBlocks);
+
+static VPBlockBase *cloneVPB(VPBlockBase *BB) {
+  if (auto *VPBB = dyn_cast<VPBasicBlock>(BB)) {
+    auto *NewBlock = new VPBasicBlock(VPBB->getName());
+    for (VPRecipeBase &R : *VPBB)
+      NewBlock->appendRecipe(R.clone());
+    return NewBlock;
+  }
+
+  auto *VPR = cast<VPRegionBlock>(BB);
+  DenseMap<VPBlockBase *, VPBlockBase *> Old2NewVPBlocks;
+  DenseMap<VPValue *, VPValue *> Old2NewVPValues;
----------------
ayalz wrote:

Is `Old2NewVPValues` needed here?

Hopefully `Old2NewVPBlocks` will not be needed either, doing instead something 
like:
```
  auto [NewEntry, NewExiting] = cloneSESE(VPR->getEntry());
```


https://github.com/llvm/llvm-project/pull/73158
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to