Disable multi-threading in V3FuncOpt (#6440)

This code is not thread safe. Specifically AstNode constructors are not
thread safe, as they may create entries in the shared Dtype table via
which can be racy.
This commit is contained in:
Geza Lore
2025-09-16 19:23:05 +01:00
committed by GitHub
parent a44907b700
commit b60ad953c4
+1 -2
View File
@@ -324,13 +324,12 @@ void V3FuncOpt::funcOptAll(AstNetlist* nodep) {
UINFO(2, __FUNCTION__ << ":");
{
const VNUser1InUse user1InUse;
V3ThreadScope threadScope;
for (AstNodeModule *modp = nodep->modulesp(), *nextModp; modp; modp = nextModp) {
nextModp = VN_AS(modp->nextp(), NodeModule);
for (AstNode *stmtp = modp->stmtsp(), *nextStmtp; stmtp; stmtp = nextStmtp) {
nextStmtp = stmtp->nextp();
if (AstCFunc* const cfuncp = VN_CAST(stmtp, CFunc)) {
threadScope.enqueue([cfuncp]() { FuncOptVisitor::apply(cfuncp); });
FuncOptVisitor::apply(cfuncp);
}
}
}