Internals: Improve Verilation peak memory usage in V3Subst (#3512).

This commit is contained in:
Kamil Rakoczy 2022-09-14 13:37:51 +02:00 committed by GitHub
parent 2564484429
commit ae466b1703
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -359,6 +359,13 @@ private:
}
virtual void visit(AstVar*) override {}
virtual void visit(AstConst*) override {}
virtual void visit(AstModule* nodep) override {
++m_ops;
if (!nodep->isSubstOptimizable()) m_ops = SUBST_MAX_OPS_NA;
iterateChildren(nodep);
// Reduce peak memory usage by reclaiming the edited AstNodes
doDeletes();
}
virtual void visit(AstNode* nodep) override {
m_ops++;
if (!nodep->isSubstOptimizable()) m_ops = SUBST_MAX_OPS_NA;