Optimize sched-initial/static/final: call splitCheck once per sub-function (#8549)

Signed-off-by: Krzysztof Bieganski <[email protected]>
This commit is contained in:
Krzysztof Bieganski
2026-09-30 10:26:54 -04:00
committed by GitHub
parent a419e91574
commit 1f0e80dbd6
+10 -1
View File
@@ -309,7 +309,8 @@ void orderSequentially(AstCFunc* funcp, const LogicByScope& lbs) {
}
subFuncp->addStmtsp(bodyp);
if (procp->needProcess()) subFuncp->setNeedProcess();
util::splitCheck(subFuncp);
// A coroutine holds a single process, so it is complete here
if (procp->isSuspendable()) util::splitCheck(subFuncp);
}
} else {
logicp->unlinkFrBack();
@@ -319,6 +320,14 @@ void orderSequentially(AstCFunc* funcp, const LogicByScope& lbs) {
if (activep->backp()) activep->unlinkFrBack();
VL_DO_DANGLING(activep->deleteTree(), activep);
}
// Split sub-functions once complete
for (const auto& pair : lbs) {
AstScope* const scopep = pair.first;
if (AstCFunc* const subFuncp = VN_AS(scopep->user1p(), CFunc)) {
util::splitCheck(subFuncp);
scopep->user1p(nullptr);
}
}
}
//============================================================================