mirror of
https://github.com/verilator/verilator.git
synced 2026-10-06 01:54:01 +02:00
Fix Dfg eliminateVar pass to remove more variables (#6091)
Failing to reset the work list pointer in vertices leads to not removing some redundant variables if they become redundant after having been considered once already.
This commit is contained in:
@@ -263,6 +263,8 @@ void V3DfgPasses::eliminateVars(DfgGraph& dfg, V3DfgEliminateVarsContext& ctx) {
|
||||
DfgVertex* const vtxp = workListp;
|
||||
// Detach the head
|
||||
workListp = vtxp->getUser<DfgVertex*>();
|
||||
// Reset user pointer so it can be added back to the work list later
|
||||
vtxp->setUser<DfgVertex*>(nullptr);
|
||||
// Prefetch next item
|
||||
VL_PREFETCH_RW(workListp);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user