Skip to content

Commit

Permalink
Fix to block fusion
Browse files Browse the repository at this point in the history
  • Loading branch information
phschaad committed Oct 29, 2024
1 parent f63f75d commit 48c7cb4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion dace/transformation/interstate/block_fusion.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Copyright 2019-2024 ETH Zurich and the DaCe authors. All rights reserved.

from dace.sdfg import utils as sdutil
from dace.sdfg.state import ControlFlowBlock, ControlFlowRegion, SDFGState
from dace.sdfg.state import AbstractControlFlowRegion, ControlFlowBlock, ControlFlowRegion, SDFGState
from dace.transformation import transformation


Expand Down Expand Up @@ -53,6 +53,9 @@ def can_be_applied(self, graph, expr_index, sdfg, permissive=False):
if out_edges[0].data.assignments:
if not in_edges:
return False
# If the first block is a control flow region, no absorbtion is possible.
if isinstance(self.first_block, AbstractControlFlowRegion):
return False
# Fail if symbol is set before the block to fuse
new_assignments = set(out_edges[0].data.assignments.keys())
if any((new_assignments & set(e.data.assignments.keys())) for e in in_edges):
Expand Down

0 comments on commit 48c7cb4

Please sign in to comment.