Skip to content

Commit

Permalink
Revert "PruneSymbols makes use of used_symbols and properly deletes i…
Browse files Browse the repository at this point in the history
…nterstate edge contents"

This reverts commit 7021e25.
  • Loading branch information
tbennun committed Nov 2, 2024
1 parent 9b24c7f commit 8c99921
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions dace/transformation/passes/prune_symbols.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,6 @@ def apply_pass(self, sdfg: SDFG, _) -> Optional[Set[Tuple[int, str]]]:
sdfg.remove_symbol(sym)
result.add(sym)

for e in sdfg.edges():
for aname in list(e.data.assignments):
if aname in result:
del e.data.assignments[aname]

if self.recursive:
# Prune nested SDFGs recursively
sid = sdfg.cfg_id
Expand Down Expand Up @@ -93,10 +88,10 @@ def used_symbols(self, sdfg: SDFG) -> Set[str]:
result |= symbolic.symbols_in_code(code.as_string)

for desc in sdfg.arrays.values():
result |= set(map(str, desc.used_symbols(False)))
result |= set(map(str, desc.free_symbols))

for state in sdfg.nodes():
result |= state.used_symbols(False)
result |= state.free_symbols
# In addition to the standard free symbols, we are conservative with other tasklet languages by
# tokenizing their code. Since this is intersected with `sdfg.symbols`, keywords such as "if" are
# ok to include
Expand All @@ -116,6 +111,6 @@ def used_symbols(self, sdfg: SDFG) -> Set[str]:
node.ignored_symbols)

for e in sdfg.edges():
result |= e.data.used_symbols(False)
result |= e.data.free_symbols

return result

0 comments on commit 8c99921

Please sign in to comment.