diff --git a/passes/opt/opt_merge.cc b/passes/opt/opt_merge.cc index eb3aa462e..e23752471 100644 --- a/passes/opt/opt_merge.cc +++ b/passes/opt/opt_merge.cc @@ -279,6 +279,10 @@ struct OptMergeWorker auto r = sharemap.insert(std::make_pair(hash, cell)); if (!r.second) { if (compare_cell_parameters_and_connections(cell, r.first->second)) { + // SILIMATE: Keep the shorter name always + if (cell->name.str() < r.first->second->name.str()) + std::swap(r.first->second, cell); + if (cell->has_keep_attr()) { if (r.first->second->has_keep_attr()) continue;