diff --git a/kernel/hashlib.h b/kernel/hashlib.h index 9c53e6687..39530baea 100644 --- a/kernel/hashlib.h +++ b/kernel/hashlib.h @@ -188,6 +188,12 @@ template struct hash_ops> { return h; } HASH_TOP_LOOP_FST (const std::pair &a) HASH_TOP_LOOP_SND + [[nodiscard]] static inline Hasher hash(const P &p, const Q &q) { + Hasher h; + h = hash_ops

::hash_into(p, h); + h = hash_ops::hash_into(q, h); + return h; + } }; template struct hash_ops> { diff --git a/passes/opt/opt_merge.cc b/passes/opt/opt_merge.cc index ba8168e74..6c81ee241 100644 --- a/passes/opt/opt_merge.cc +++ b/passes/opt/opt_merge.cc @@ -107,7 +107,7 @@ struct OptMergeWorker for (const auto& [port, sig] : cell->connections()) { if (cell->output(port)) continue; - comm.eat(hash_ops>::hash({port, assign_map(sig)})); + comm.eat(hash_ops>::hash(port, assign_map(sig))); } h = comm.hash_into(h); if (RTLIL::builtin_ff_cell_types().count(cell->type))