Internals: Add special Dfg vertex for replication (#7471)

This commit is contained in:
Geza Lore
2026-04-23 10:14:27 +01:00
committed by GitHub
parent cfebe805c9
commit 3149f43372
11 changed files with 149 additions and 119 deletions
+21
View File
@@ -384,6 +384,26 @@ class AstToDfgConverter final : public VNVisitor {
nodep->user2p(vtxp);
}
}
void visit(AstReplicate* nodep) override {
UASSERT_OBJ(m_converting, nodep, "AstToDfg visit called without m_converting");
UASSERT_OBJ(!nodep->user2p(), nodep, "Already has Dfg vertex");
if (unhandled(nodep)) return;
const DfgDataType* const dtypep = DfgDataType::fromAst(nodep->dtypep());
if (!dtypep) {
m_foundUnhandled = true;
++m_ctx.m_conv.nonRepDType;
return;
}
iterate(nodep->srcp());
if (m_foundUnhandled) return;
FileLine* const flp = nodep->fileline();
DfgRep* const vtxp = make<DfgRep>(flp, *dtypep);
vtxp->srcp(nodep->srcp()->user2u().to<DfgVertex*>());
nodep->user2p(vtxp);
}
void visit(AstSel* nodep) override {
UASSERT_OBJ(m_converting, nodep, "AstToDfg visit called without m_converting");
UASSERT_OBJ(!nodep->user2p(), nodep, "Already has Dfg vertex");
@@ -426,6 +446,7 @@ class AstToDfgConverter final : public VNVisitor {
}
nodep->user2p(vtxp);
}
// The rest of the visit methods for expressions are generated by 'astgen'
#include "V3Dfg__gen_ast_to_dfg.h"