diff --git a/dace/transformation/passes/dead_state_elimination.py b/dace/transformation/passes/dead_state_elimination.py index cc7e262e4d..80ecaa49fb 100644 --- a/dace/transformation/passes/dead_state_elimination.py +++ b/dace/transformation/passes/dead_state_elimination.py @@ -77,6 +77,10 @@ def apply_pass(self, sdfg: SDFG, _) -> Optional[Set[Union[SDFGState, Edge[Inters cfg.remove_node(node) else: result.add(node) + is_start = node is cfg.start_block + replacement_pre = cfg.add_state_before(node, node.label + '_pre', is_start_block=is_start) + replacement_post = cfg.add_state_after(node, node.label + '_post') + cfg.add_edge(replacement_pre, replacement_post, InterstateEdge()) cfg.remove_node(node) if not annotated: