Fix gate deduplication with function arguments (#8038)

This commit is contained in:
JOTEGO
2026-08-04 04:36:25 -04:00
committed by GitHub
parent 15b75c7c68
commit ba8e4f9dec
4 changed files with 98 additions and 19 deletions
+3 -3
View File
@@ -985,9 +985,9 @@ public:
if (m_dedupable && m_assignp) {
const AstNode* const lhsp = m_assignp->lhsp();
// Possible todo, handle more complex lhs expressions
if (const AstNodeVarRef* const lRefp = VN_CAST(lhsp, NodeVarRef)) {
UASSERT_OBJ(lRefp->varScopep() == consumerVscp, consumerVscp,
"Consumer doesn't match lhs of assign");
// A logic vertex may also contain a function argument assignment.
const AstNodeVarRef* const lRefp = VN_CAST(lhsp, NodeVarRef);
if (lRefp && lRefp->varScopep() == consumerVscp) {
if (const AstNodeAssign* const dup
= m_ghash.hashAndFindDupe(m_assignp, activep, m_ifCondp)) {
return static_cast<AstNodeVarRef*>(dup->lhsp());