From d059806dbdfe76596063ad84444d7a313f419a62 Mon Sep 17 00:00:00 2001 From: Geza Lore Date: Sun, 15 Jun 2025 18:12:37 +0100 Subject: [PATCH] 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. --- src/V3DfgPasses.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/V3DfgPasses.cpp b/src/V3DfgPasses.cpp index 5c82ba149..5b6ffb81a 100644 --- a/src/V3DfgPasses.cpp +++ b/src/V3DfgPasses.cpp @@ -263,6 +263,8 @@ void V3DfgPasses::eliminateVars(DfgGraph& dfg, V3DfgEliminateVarsContext& ctx) { DfgVertex* const vtxp = workListp; // Detach the head workListp = vtxp->getUser(); + // Reset user pointer so it can be added back to the work list later + vtxp->setUser(nullptr); // Prefetch next item VL_PREFETCH_RW(workListp);