twine: GC selection_stack

This commit is contained in:
Emil J. Tywoniak
2026-10-02 18:42:02 +02:00
parent 6f98cf1bd7
commit 7afe1bfb89
+9 -2
View File
@@ -794,8 +794,7 @@ size_t RTLIL::Design::gc_twines()
}
}
for (auto &[name, sel] : selection_vars) {
root(name);
auto root_selection = [&](const RTLIL::Selection &sel) {
for (IdString m : sel.selected_modules)
root(m);
for (auto &[m, members] : sel.selected_members) {
@@ -803,8 +802,16 @@ size_t RTLIL::Design::gc_twines()
for (IdString member : members)
root(member);
}
};
for (auto &[name, sel] : selection_vars) {
root(name);
root_selection(sel);
}
for (auto &sel : selection_stack)
root_selection(sel);
size_t erased = twines.gc(live);
int64_t time_ns = PerformanceTimer::query() - start;