Fix array trace splitting (#5549)

This commit is contained in:
Todd Strader
2024-10-23 11:51:48 -04:00
committed by GitHub
parent d3d45c0be5
commit 8cc7e180ca
3 changed files with 60 additions and 1 deletions
+7 -1
View File
@@ -708,7 +708,13 @@ class TraceVisitor final : public VNVisitor {
// Track splitting due to size
UASSERT_OBJ(incFulp->nodeCount() == incChgp->nodeCount(), declp,
"Should have equal cost");
subStmts += incChgp->nodeCount();
const VNumRange range = declp->arrayRange();
if (range.ranged()) {
// 2x because each element is a TraceInc and a VarRef
subStmts += range.elements() * 2;
} else {
subStmts += incChgp->nodeCount();
}
// Track partitioning
nCodes += declp->codeInc();