Skip to content

Commit

Permalink
Fix a bug where dead state elimination leads to disconnected graphs (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
phschaad authored Jan 15, 2025
1 parent 9e4c24b commit 45b00ee
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions dace/transformation/passes/dead_state_elimination.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 45b00ee

Please sign in to comment.