mirror of
https://github.com/YosysHQ/yosys
synced 2025-10-01 05:29:29 +00:00
Merge pull request #5384 from rocallahan/simplify-opt-merge-logic
Move `OptMerge` cell filtering logic to happen while building the cell vector
This commit is contained in:
commit
87c1a868d3
1 changed files with 7 additions and 8 deletions
|
@ -246,9 +246,14 @@ struct OptMergeWorker
|
||||||
// mem can have an excessively large parameter holding the init data
|
// mem can have an excessively large parameter holding the init data
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
if (cell->type == ID($scopeinfo))
|
||||||
|
continue;
|
||||||
if (mode_keepdc && has_dont_care_initval(cell))
|
if (mode_keepdc && has_dont_care_initval(cell))
|
||||||
continue;
|
continue;
|
||||||
if (ct.cell_known(cell->type) || (mode_share_all && cell->known()))
|
if (!cell->known())
|
||||||
|
continue;
|
||||||
|
if (!mode_share_all && !ct.cell_known(cell->type))
|
||||||
|
continue;
|
||||||
cells.push_back(cell);
|
cells.push_back(cell);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -278,12 +283,6 @@ struct OptMergeWorker
|
||||||
|
|
||||||
for (auto cell : cells)
|
for (auto cell : cells)
|
||||||
{
|
{
|
||||||
if ((!mode_share_all && !ct.cell_known(cell->type)) || !cell->known())
|
|
||||||
continue;
|
|
||||||
|
|
||||||
if (cell->type == ID($scopeinfo))
|
|
||||||
continue;
|
|
||||||
|
|
||||||
auto [cell_in_map, inserted] = known_cells.insert(cell);
|
auto [cell_in_map, inserted] = known_cells.insert(cell);
|
||||||
if (!inserted) {
|
if (!inserted) {
|
||||||
// We've failed to insert since we already have an equivalent cell
|
// We've failed to insert since we already have an equivalent cell
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue