Do not unroll simple array assignments in V3Slice (#7359)

See also #5644
This commit is contained in:
Geza Lore
2026-04-01 22:35:29 +01:00
committed by GitHub
parent 894f6c4c58
commit 2e151c3b74
4 changed files with 22 additions and 3 deletions
+10
View File
@@ -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;