Skip to content

Commit

Permalink
Revert "opt_merge: try pool?"
Browse files Browse the repository at this point in the history
This reverts commit 4db3e78.
  • Loading branch information
widlarizer committed Nov 13, 2024
1 parent e30afc9 commit 1b49bce
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
2 changes: 1 addition & 1 deletion kernel/hashlib.h
Original file line number Diff line number Diff line change
Expand Up @@ -1002,7 +1002,7 @@ class pool
constexpr pool()
{
}
pool (OPS ops) : ops(ops) { }

pool(const pool &other)
{
entries = other.entries;
Expand Down
19 changes: 13 additions & 6 deletions passes/opt/opt_merge.cc
Original file line number Diff line number Diff line change
Expand Up @@ -282,17 +282,24 @@ struct OptMergeWorker
// We keep a set of known cells. They're hashed with our hash_cell_function
// and compared with our compare_cell_parameters_and_connections.
// Both need to capture OptMergeWorker to access initvals
struct CellPtrOps {
struct CellPtrHash {
const OptMergeWorker& worker;
CellPtrOps(const OptMergeWorker& w) : worker(w) {}
Hasher hash(const Cell* c) const {
return worker.hash_cell_function(c, Hasher());
CellPtrHash(const OptMergeWorker& w) : worker(w) {}
std::size_t operator()(const Cell* c) const {
return (std::size_t)worker.hash_cell_function(c, Hasher()).yield();
}
bool cmp(const Cell* lhs, const Cell* rhs) const {
};
struct CellPtrEqual {
const OptMergeWorker& worker;
CellPtrEqual(const OptMergeWorker& w) : worker(w) {}
bool operator()(const Cell* lhs, const Cell* rhs) const {
return worker.compare_cell_parameters_and_connections(lhs, rhs);
}
};
pool<RTLIL::Cell*, CellPtrOps> known_cells (CellPtrOps(*this));
std::unordered_set<
RTLIL::Cell*,
CellPtrHash,
CellPtrEqual> known_cells (0, CellPtrHash(*this), CellPtrEqual(*this));

for (auto cell : cells)
{
Expand Down

0 comments on commit 1b49bce

Please sign in to comment.