mirror of
https://github.com/verilator/verilator.git
synced 2026-10-06 01:54:01 +02:00
Do not unroll simple array assignments in V3Slice (#7359)
See also #5644
This commit is contained in:
@@ -260,6 +260,16 @@ class SliceVisitor final : public VNVisitor {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Skip if this is a simple a = b assignment of identical arrays
|
||||
if (AstVarRef* const lhsp = VN_CAST(nodep->lhsp(), VarRef)) {
|
||||
if (AstVarRef* const rhsp = VN_CAST(nodep->rhsp(), VarRef)) {
|
||||
if (!hasSc && lhsp->dtypep()->skipRefp()->sameTree(rhsp->dtypep()->skipRefp())) {
|
||||
m_okInitArray = true; // VL_RESTORER in visit(AstNodeAssign)
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
UINFO(4, "Slice optimizing " << nodep);
|
||||
++m_statAssigns;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user