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
+7 -4
View File
@@ -97,6 +97,11 @@ std::unique_ptr<DfgGraph> DfgGraph::clone() const {
vtxp2clonep.emplace(&vtx, cp);
break;
}
case VDfgType::Rep: {
DfgRep* const cp = new DfgRep{*clonep, vtx.fileline(), vtx.dtype()};
vtxp2clonep.emplace(&vtx, cp);
break;
}
case VDfgType::UnitArray: {
DfgUnitArray* const cp = new DfgUnitArray{*clonep, vtx.fileline(), vtx.dtype()};
vtxp2clonep.emplace(&vtx, cp);
@@ -712,12 +717,10 @@ void DfgVertex::typeCheck(const DfgGraph& dfg) const {
return;
}
case VDfgType::Replicate: {
// TODO: model DfgReplicate without an explicit 'countp' which is always constant
const DfgReplicate& v = *as<DfgReplicate>();
case VDfgType::Rep: {
const DfgRep& v = *as<DfgRep>();
CHECK(v.isPacked(), "Should be Packed type");
CHECK(v.srcp()->isPacked(), "'srcp' should be same type");
CHECK(v.countp()->isPacked(), "'countp' should be Packed type");
CHECK(v.size() % v.srcp()->size() == 0, "Not a replicate");
return;
}