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:
Geza Lore 2025-06-15 18:12:37 +01:00 committed by GitHub
parent bca2e2c16e
commit d059806dbd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 0 deletions

View File

@ -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);