Skip to content

Commit

Permalink
check if symbol is written in the state containing the nested sdfg
Browse files Browse the repository at this point in the history
  • Loading branch information
luigifusco committed Sep 6, 2024
1 parent e86df3f commit 491a4b2
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion dace/transformation/interstate/if_extraction.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,15 @@ def can_be_applied(self, graph, expr_index, sdfg, permissive=False):
for e in sdfg.predecessor_state_transitions(start_state):
available_symbols |= e.data.new_symbols(sdfg, available_symbols).keys()

# check if edges can be moved out (used symbols can be computed in the outer scope)
# check if used symbols can be computed in the outer scope
if not if_symbols.issubset(available_symbols):
return False

# check if symbols are not written in the state containing the nested sdfg
_, wset = sdfg.parent.read_and_write_sets()
if len(if_symbols.intersection(wset)) != 0:
return False

return True


Expand Down

0 comments on commit 491a4b2

Please sign in to comment.