[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
================
@@ -822,32 +834,27 @@ void VPRegionBlock::print(raw_ostream &O, const Twine &Indent,
#endif
VPlan::VPlan(Loop *L) {
- setEntry(VPIRBasicBlock::fromBasicBlock(L->getLoopPreheader()));
- ScalarHeader = VPIRBasicBlock::fromBasicBlock(L->getHeader());
+ setEntry(createVPIRBasicBlock(L->getLoopPreheader()));
+ ScalarHeader = createVPIRBasicBlock(L->getHeader());
}
VPlan::~VPlan() {
if (Entry) {
VPValue DummyValue;
- for (VPBlockBase *Block : vp_depth_first_shallow(Entry))
- Block->dropAllReferences(&DummyValue);
- VPBlockBase::deleteCFG(Entry);
+ for (auto *VPB : reverse(CreatedBlocks))
+ VPB->dropAllReferences(&DummyValue);
+
+ for (auto *VPB : reverse(CreatedBlocks)) {
----------------
ayalz wrote:
Why/Is reverse needed?
https://github.com/llvm/llvm-project/pull/120918
More information about the llvm-commits
mailing list