Add an ovbious optimization.

This commit is contained in:
Yutetsu TAKATSUKASA 2020-01-17 06:42:09 +09:00
parent a31a942586
commit 718ebd4506
1 changed files with 8 additions and 4 deletions

View File

@ -174,8 +174,10 @@ class SplitUnpackedVarVisitor : public AstNVisitor {
pragmap->unlinkFrBack()->deleteTree(); VL_DANGLING(vars[i].first);
}
}
iterateChildren(nodep);
split();
if (!vars.empty()) { // need to check this module only when split_var pragma exists in this module.
iterateChildren(nodep);
split();
}
m_modp = NULL;
}
virtual void visit(AstVarRef* nodep) VL_OVERRIDE {
@ -494,8 +496,10 @@ class SplitPackedVarVisitor : public AstNVisitor {
// consume the pragma here anyway.
pragmap->unlinkFrBack()->deleteTree(); VL_DANGLING(vars[i].first);
}
iterateChildren(nodep);
split();
if (!vars.empty()) { // need to check this module only when split_var pragma exists in this module.
iterateChildren(nodep);
split();
}
m_modp = NULL;
}
virtual void visit(AstVarRef* nodep) VL_OVERRIDE {