Skip to content

Commit

Permalink
Do not inadvertently simplify expressions when computing free symbols
Browse files Browse the repository at this point in the history
  • Loading branch information
tbennun committed Sep 24, 2023
1 parent 92c7a14 commit 07b06f3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion dace/sdfg/sdfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ def used_symbols(self, all_symbols: bool) -> Set[str]:
rhs_symbols = set()
for lhs, rhs in self.assignments.items():
# Always add LHS symbols to the set of candidate free symbols
rhs_symbols |= symbolic.free_symbols_and_functions(rhs)
rhs_symbols |= set(map(str, dace.symbolic.symbols_in_ast(ast.parse(rhs))))
# Add the RHS to the set of candidate defined symbols ONLY if it has not been read yet
# This also solves the ordering issue that may arise in cases like the 3rd example above
if lhs not in cond_symbols and lhs not in rhs_symbols:
Expand Down

0 comments on commit 07b06f3

Please sign in to comment.