Support more DFG containers in `SimpleReplament`
Closed this issue · 2 comments
aborgna-q commented
SiblingSubgraph::create_simple_replacement
requires the region root to be an Optype::Dfg
.
hugr/hugr-core/src/hugr/views/sibling_subgraph.rs
Lines 342 to 344 in 6eb6d56
We should support
FuncDefn
and DataflowBlock
too.aborgna-q commented
Alternatively, if we want to keep the SimpleReplacement simple and only support Dfg
s there should be a helper method for converting other dataflow-like blocks into one.
aborgna-q commented
We went with the alternative option and solved our usecase in tket2
by converting replacement circuits into DFGs. See CQCL/tket2#391.
We may want to bring that extraction code into hugr-passes later, but I'll mark this PR as WONTDO.