Delete orphaned gate expression when dist gating is skipped

This commit is contained in:
Yilou Wang 2026-07-14 15:30:32 +02:00
parent 71334a9234
commit 8e6fab3075
1 changed files with 4 additions and 1 deletions

View File

@ -4624,7 +4624,10 @@ class RandomizeVisitor final : public VNVisitor {
rmode.index);
}
});
if (alwaysActive || !gatep) return chainp;
if (alwaysActive || !gatep) {
if (gatep) VL_DO_DANGLING(pushDeletep(gatep), gatep);
return chainp;
}
AstNodeExpr* unionExprp = nullptr;
for (auto& bucket : buckets) {