Skip to content

Commit

Permalink
More fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
phschaad committed Nov 13, 2024
1 parent 567d307 commit 61ac6ee
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions dace/transformation/passes/constant_propagation.py
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,14 @@ def _collect_constants_for_region(self, cfg: ControlFlowRegion, arrays: Set[str]
if reassignments and (used_in_assignments - reassignments):
assignments[aname] = _UnknownValue

if isinstance(block, LoopRegion):
# Any constants before a loop that may be overwritten inside the loop cannot be assumed as constants
# for the loop itself.
assigned_in_loop = self._assignments_in_loop(block)
for k in assignments.keys():
if k in assigned_in_loop:
assignments[k] = _UnknownValue

if block not in in_const_dict:
in_const_dict[block] = {}
if assignments:
Expand Down

0 comments on commit 61ac6ee

Please sign in to comment.