Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Complete Transition to Control Flow Regions #1676

Merged
merged 128 commits into from
Dec 12, 2024
Merged
Show file tree
Hide file tree
Changes from 17 commits
Commits
Show all changes
128 commits
Select commit Hold shift + click to select a range
036e407
Add data dependency analyses
phschaad Sep 16, 2024
4aa13ed
Fix type
phschaad Sep 16, 2024
a228f34
Fix types
phschaad Sep 16, 2024
10c3b6c
Update tests
phschaad Sep 16, 2024
77ca17f
Fixes
phschaad Sep 16, 2024
4e6035d
Fix tests
phschaad Sep 17, 2024
b61a283
Add tests
phschaad Sep 17, 2024
05b1c28
Add loop lifting capabilities
phschaad Sep 18, 2024
f08d95e
Adjust loop detection to LLVM canonical semantics
phschaad Sep 19, 2024
1d90346
Test fix
phschaad Sep 19, 2024
6b5ef0c
Remove unnecessary imports
phschaad Sep 19, 2024
ba5ccdf
Merge branch 'master' into cf_block_data_deps
phschaad Sep 30, 2024
23af038
Improved loop detection
phschaad Oct 2, 2024
3fbe26b
Loop detection and lifting fixes
phschaad Oct 2, 2024
2bd5d00
Work on conditional lifting
phschaad Oct 2, 2024
dc640a9
Improve conditional block interface
phschaad Oct 7, 2024
e14e7a4
Merge branch 'cf_block_data_deps' into users/phschaad/adapt_passes
phschaad Oct 7, 2024
02d53fc
Remove files from other PR
phschaad Oct 7, 2024
338db80
Merge branch 'cf_block_data_deps' into users/phschaad/adapt_passes
phschaad Oct 7, 2024
074a990
Add back missing file
phschaad Oct 7, 2024
cd8a258
Adapt dead state elimination
phschaad Oct 7, 2024
f77655f
Adapt DeadDataflowElimination
phschaad Oct 7, 2024
49475ec
Fixes
phschaad Oct 8, 2024
094c896
Merge branch 'cf_block_data_deps' into users/phschaad/adapt_passes
phschaad Oct 8, 2024
2a74901
Bugfix
phschaad Oct 8, 2024
35cfded
Merge branch 'cf_block_data_deps' into users/phschaad/adapt_passes
phschaad Oct 8, 2024
8127900
Adapt trivial loop elimination and state elimination
phschaad Oct 8, 2024
04f41c2
gdapt passes:
phschaad Oct 8, 2024
852719d
Adapt loop to map
phschaad Oct 9, 2024
352171a
Fixes in loop to map
phschaad Oct 9, 2024
bbddc88
Finished LoopToMap
phschaad Oct 9, 2024
5ef1f46
Adapt loop unrolling
phschaad Oct 9, 2024
2d26e0f
Adapt loop peeling and unrolling
phschaad Oct 10, 2024
145c0ea
Added tests for the `_read_and_write_sets()`.
philip-paul-mueller Oct 11, 2024
38e748b
Added the fix from my MapFusion PR.
philip-paul-mueller Oct 11, 2024
3748c03
Now made `read_and_write_sets()` fully adhere to their own definition.
philip-paul-mueller Oct 11, 2024
6d83976
Update refine nested access
phschaad Oct 11, 2024
bb4e9c8
Fixes
phschaad Oct 11, 2024
bd76961
Adjust SDFG nesting
phschaad Oct 11, 2024
3ab4bf3
Updated a test for the `PruneConnectors` transformation.
philip-paul-mueller Oct 11, 2024
26e4ff0
Adapt more passes and add conditional pruning pass
phschaad Oct 11, 2024
b4feddf
Added code to `test_more_than_a_map` to ensure that the transformatio…
philip-paul-mueller Oct 11, 2024
324fa34
More fixes
phschaad Oct 11, 2024
103b4e5
Merge remote-tracking branch 'origin/master' into users/phschaad/adap…
phschaad Oct 13, 2024
e1c25b2
Merge remote-tracking branch 'spcl/master' into read-write-sets
philip-paul-mueller Oct 14, 2024
70fa3db
Added the new memlet creation syntax.
philip-paul-mueller Oct 14, 2024
b187a82
Modified some comments to make them clearer.
philip-paul-mueller Oct 14, 2024
9c6cb6c
Modified the `tests/transformations/move_loop_into_map_test.py::test_…
philip-paul-mueller Oct 14, 2024
251833f
Adapt scalar fission and symbol ssa
phschaad Oct 15, 2024
5b7bdad
Fixes
phschaad Oct 15, 2024
99225a5
Adapt reference reduction pass
phschaad Oct 15, 2024
d6c7c8b
Adapt constant propagation
phschaad Oct 16, 2024
607b098
Fix pytest arguments
phschaad Oct 16, 2024
05b3e59
Fixes
phschaad Oct 16, 2024
f5b617c
Fix invalid graph manipulation in test
phschaad Oct 16, 2024
33c9287
Fixes
phschaad Oct 16, 2024
9185897
Adapt composite fusion
phschaad Oct 16, 2024
bf7d822
Fix StencilTiling
phschaad Oct 17, 2024
78803d5
Add some region inlining
phschaad Oct 17, 2024
26a7fbc
Fixes to deepcopy
phschaad Oct 17, 2024
1862ba4
More various fixes
phschaad Oct 17, 2024
422edb5
Yet more fixes
phschaad Oct 17, 2024
a66c610
More fixes
phschaad Oct 18, 2024
b507a4b
Fixes
phschaad Oct 18, 2024
4084dfe
More fixes
phschaad Oct 18, 2024
d010620
More fixes
phschaad Oct 18, 2024
a047d37
And yet more
phschaad Oct 18, 2024
39db909
Another one
phschaad Oct 18, 2024
b5fc16f
Merge branch 'master' into read-write-sets
philip-paul-mueller Oct 22, 2024
b7fe242
Added a test to highlights the error.
philip-paul-mueller Oct 22, 2024
b546b07
I now removed the filtering inside the read and write set.
philip-paul-mueller Oct 22, 2024
8f9e72f
And more
phschaad Oct 22, 2024
6067e3b
Merge remote-tracking branch 'origin/master' into users/phschaad/adap…
phschaad Oct 22, 2024
2c4c17b
Fix inline multistate
phschaad Oct 22, 2024
ae20590
Fixed `state_test.py::test_read_and_write_set_filter`.
philip-paul-mueller Oct 23, 2024
db211fa
Fixed the `state_test.py::test_read_write_set` test.
philip-paul-mueller Oct 23, 2024
570437b
Fixed the `state_test.py::test_read_write_set_y_formation` test.
philip-paul-mueller Oct 23, 2024
6806dc1
Fix cyclic dependency
phschaad Oct 23, 2024
ab255e8
Fixes to codegen and data instrumentation
phschaad Oct 23, 2024
e97f5bc
Fix subgraph nesting
phschaad Oct 23, 2024
8de1c1e
Fixes to GPU codegen
phschaad Oct 23, 2024
cb80f0b
Fixed `move_loop_into_map_test.py::MoveLoopIntoMapTest::test_more_tha…
philip-paul-mueller Oct 23, 2024
b704a43
Fixed `prune_connectors_test.py::test_read_write_*`.
philip-paul-mueller Oct 23, 2024
f74d6e8
General improvements to some tests.
philip-paul-mueller Oct 23, 2024
e103924
Updated `refine_nested_access_test.py::test_rna_read_and_write_sets_d…
philip-paul-mueller Oct 23, 2024
56e756d
More GPU fixes
phschaad Oct 23, 2024
6e14e6d
More fixes
phschaad Oct 23, 2024
1902e3d
Merge branch 'read-write-sets' into users/phschaad/adapt_passes
phschaad Oct 23, 2024
0c65359
More bugfixes
phschaad Oct 23, 2024
ac72cb1
Fixes
phschaad Oct 23, 2024
3c4cea0
Merge remote-tracking branch 'origin/master' into users/phschaad/adap…
phschaad Oct 24, 2024
cc9e5f4
FPGA fixes
phschaad Oct 24, 2024
cfa0299
Merge remote-tracking branch 'origin/main' into users/phschaad/adapt_…
phschaad Oct 25, 2024
bc9f61e
Adapt state propagation into a pass to adapt it
phschaad Oct 29, 2024
2a26d24
Merge remote-tracking branch 'origin/main' into users/phschaad/adapt_…
phschaad Oct 29, 2024
f63f75d
Fix w/d test inlining
phschaad Oct 29, 2024
48c7cb4
Fix to block fusion
phschaad Oct 29, 2024
a0e2c59
Derped a test..
phschaad Oct 29, 2024
ca00134
Merge branch 'main' into users/phschaad/adapt_passes
phschaad Oct 31, 2024
8d03dc5
Merge branch 'main' into users/phschaad/adapt_passes
phschaad Nov 5, 2024
0828fa1
Fix inlining
phschaad Nov 5, 2024
07c822c
Merge branch 'main' into users/phschaad/adapt_passes
phschaad Nov 12, 2024
3094fa1
Update SDFV
phschaad Nov 12, 2024
38fcbaf
Endless loop in constant prop fix
phschaad Nov 12, 2024
567d307
Fix propagation
phschaad Nov 12, 2024
61ac6ee
More fixes
phschaad Nov 13, 2024
8c488de
Update gitignore
phschaad Nov 13, 2024
7e4bc3d
Fix loop symbol type inference and loop to map
phschaad Nov 13, 2024
40d4a12
Fix traversal for defined symbols
phschaad Nov 13, 2024
c61af96
Merge branch 'main' into users/phschaad/adapt_passes
phschaad Nov 25, 2024
ef595b4
Skip FV3 pipeline until adapted to V2
phschaad Dec 3, 2024
3af9a70
Merge branch 'main' into users/phschaad/adapt_passes
phschaad Dec 3, 2024
d27ec31
Fix bug introduced through merge
phschaad Dec 3, 2024
786a07e
Merge branch 'main' into users/phschaad/adapt_passes
phschaad Dec 9, 2024
72508bd
Update dace/transformation/interstate/block_fusion.py
phschaad Dec 9, 2024
ce82732
Address review comments
phschaad Dec 9, 2024
83b26c1
Merge branch 'users/phschaad/adapt_passes' of github.com:spcl/dace in…
phschaad Dec 9, 2024
3c13369
More comments
phschaad Dec 9, 2024
c4e78d7
Add doc comments
phschaad Dec 9, 2024
3a2b342
Address more comments
phschaad Dec 9, 2024
2f7d6aa
Address more review comments
phschaad Dec 10, 2024
a469286
Inlining fix
phschaad Dec 10, 2024
a8546ab
Fixes to control flow raising and codegen
phschaad Dec 11, 2024
c9d6b51
Renamed experimental_cfg_blocks to explicit_control_flow
phschaad Dec 11, 2024
e2a6466
Added more extensible meta access replacement function
phschaad Dec 11, 2024
6f82fc6
Fixes
phschaad Dec 11, 2024
34a3247
Add more API methods
phschaad Dec 11, 2024
fad3424
Address comments
phschaad Dec 12, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions .github/workflows/pyFV3-ci.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
name: NASA/NOAA pyFV3 repository build test

# Temporarily disabled for main, and instead applied to a specific DaCe v1 maintenance branch (v1/maintenance). Once
# the FV3 bridge has been adapted to DaCe v1, this will need to be reverted back to apply to main.
on:
push:
branches: [ main, ci-fix ]
#branches: [ main, ci-fix ]
branches: [ v1/maintenance, ci-fix ]
pull_request:
branches: [ main, ci-fix ]
#branches: [ main, ci-fix ]
branches: [ v1/maintenance, ci-fix ]
merge_group:
branches: [ main, ci-fix ]
#branches: [ main, ci-fix ]
branches: [ v1/maintenance, ci-fix ]

defaults:
run:
Expand Down
44 changes: 28 additions & 16 deletions dace/codegen/control_flow.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2019-2021 ETH Zurich and the DaCe authors. All rights reserved.
# Copyright 2019-2024 ETH Zurich and the DaCe authors. All rights reserved.
"""
Various classes to facilitate the code generation of structured control
flow elements (e.g., ``for``, ``if``, ``while``) from state machines in SDFGs.
Expand Down Expand Up @@ -200,7 +200,10 @@ class BreakCFBlock(ControlFlow):
block: BreakBlock

def as_cpp(self, codegen, symbols) -> str:
return 'break;\n'
cfg = self.block.parent_graph
expr = '__state_{}_{}:;\n'.format(cfg.cfg_id, self.block.label)
expr += 'break;\n'
return expr

@property
def first_block(self) -> BreakBlock:
Expand All @@ -214,7 +217,10 @@ class ContinueCFBlock(ControlFlow):
block: ContinueBlock

def as_cpp(self, codegen, symbols) -> str:
return 'continue;\n'
cfg = self.block.parent_graph
expr = '__state_{}_{}:;\n'.format(cfg.cfg_id, self.block.label)
expr += 'continue;\n'
return expr

@property
def first_block(self) -> ContinueBlock:
Expand All @@ -228,7 +234,10 @@ class ReturnCFBlock(ControlFlow):
block: ReturnBlock

def as_cpp(self, codegen, symbols) -> str:
return 'return;\n'
cfg = self.block.parent_graph
expr = '__state_{}_{}:;\n'.format(cfg.cfg_id, self.block.label)
expr += 'return;\n'
return expr

@property
def first_block(self) -> ReturnBlock:
Expand Down Expand Up @@ -316,7 +325,13 @@ def as_cpp(self, codegen, symbols) -> str:
# One unconditional edge
if (len(out_edges) == 1 and out_edges[0].data.is_unconditional()):
continue
expr += f'goto __state_exit_{sdfg.cfg_id};\n'
if self.region:
expr += f'goto __state_exit_{self.region.cfg_id};\n'
else:
expr += f'goto __state_exit_{sdfg.cfg_id};\n'

if self.region and not isinstance(self.region, SDFG):
expr += f'__state_exit_{self.region.cfg_id}:;\n'

return expr

Expand Down Expand Up @@ -575,6 +590,8 @@ def as_cpp(self, codegen, symbols) -> str:
expr += _clean_loop_body(self.body.as_cpp(codegen, symbols))
expr += '\n}\n'

expr += f'__state_exit_{self.loop.cfg_id}:;\n'

return expr

@property
Expand Down Expand Up @@ -1022,21 +1039,16 @@ def _structured_control_flow_traversal_with_regions(cfg: ControlFlowRegion,
start: Optional[ControlFlowBlock] = None,
stop: Optional[ControlFlowBlock] = None,
generate_children_of: Optional[ControlFlowBlock] = None,
branch_merges: Optional[Dict[ControlFlowBlock,
ControlFlowBlock]] = None,
ptree: Optional[Dict[ControlFlowBlock, ControlFlowBlock]] = None,
visited: Optional[Set[ControlFlowBlock]] = None):
if branch_merges is None:
branch_merges = cfg_analysis.branch_merges(cfg)

if ptree is None:
ptree = cfg_analysis.block_parent_tree(cfg, with_loops=False)

start = start if start is not None else cfg.start_block

def make_empty_block():
def make_empty_block(region):
return GeneralBlock(dispatch_state, parent_block,
last_block=False, region=None, elements=[], gotos_to_ignore=[],
last_block=False, region=region, elements=[], gotos_to_ignore=[],
gotos_to_break=[], gotos_to_continue=[], assignments_to_ignore=[], sequential=True)

# Traverse states in custom order
Expand All @@ -1063,18 +1075,18 @@ def make_empty_block():
cfg_block = GeneralConditionalScope(dispatch_state, parent_block, False, node, [])
for cond, branch in node.branches:
if branch is not None:
body = make_empty_block()
body = make_empty_block(branch)
body.parent = cfg_block
_structured_control_flow_traversal_with_regions(branch, dispatch_state, body)
cfg_block.branch_bodies.append((cond, body))
elif isinstance(node, ControlFlowRegion):
if isinstance(node, LoopRegion):
body = make_empty_block()
body = make_empty_block(node)
cfg_block = GeneralLoopScope(dispatch_state, parent_block, False, node, body)
body.parent = cfg_block
_structured_control_flow_traversal_with_regions(node, dispatch_state, body)
else:
cfg_block = make_empty_block()
cfg_block = make_empty_block(node)
cfg_block.region = node
_structured_control_flow_traversal_with_regions(node, dispatch_state, cfg_block)

Expand Down Expand Up @@ -1132,7 +1144,7 @@ def structured_control_flow_tree(sdfg: SDFG, dispatch_state: Callable[[SDFGState
:param sdfg: The SDFG to iterate over.
:return: Control-flow block representing the entire SDFG.
"""
if sdfg.root_sdfg.using_experimental_blocks:
if sdfg.root_sdfg.using_explicit_control_flow:
return structured_control_flow_tree_with_regions(sdfg, dispatch_state)

# Avoid import loops
Expand Down
16 changes: 2 additions & 14 deletions dace/codegen/targets/framecode.py
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,7 @@ def dispatch_state(state: SDFGState) -> str:
states_generated.add(state) # For sanity check
return stream.getvalue()

if sdfg.root_sdfg.recheck_using_experimental_blocks():
if sdfg.root_sdfg.recheck_using_explicit_control_flow():
# Use control flow blocks embedded in the SDFG to generate control flow.
cft = cflow.structured_control_flow_tree_with_regions(sdfg, dispatch_state)
elif config.Config.get_bool('optimizer', 'detect_control_flow'):
Expand Down Expand Up @@ -697,19 +697,7 @@ def determine_allocation_lifetime(self, top_sdfg: SDFG):
if name in self.free_symbols(isedge.data):
multistate = True
for cfg in sdfg.all_control_flow_regions():
tbennun marked this conversation as resolved.
Show resolved Hide resolved
block_syms = set()
if isinstance(cfg, LoopRegion):
block_syms |= symbolic.free_symbols_and_functions(cfg.loop_condition.as_string)
update_stmt = loop_analysis.get_update_assignment(cfg)
init_stmt = loop_analysis.get_init_assignment(cfg)
if update_stmt:
block_syms |= symbolic.free_symbols_and_functions(update_stmt)
if init_stmt:
block_syms |= symbolic.free_symbols_and_functions(init_stmt)
elif isinstance(cfg, ConditionalBlock):
for cond, _ in cfg.branches:
if cond is not None:
block_syms |= symbolic.free_symbols_and_functions(cond.as_string)
block_syms = cfg.used_symbols(all_symbols=True, with_contents=False)
if name in block_syms:
multistate = True

Expand Down
18 changes: 9 additions & 9 deletions dace/frontend/fortran/fortran_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class AST_translator:
"""
This class is responsible for translating the internal AST into a SDFG.
"""
def __init__(self, ast: ast_components.InternalFortranAst, source: str, use_experimental_cfg_blocks: bool = False):
def __init__(self, ast: ast_components.InternalFortranAst, source: str, use_explicit_cf: bool = False):
"""
:ast: The internal fortran AST to be used for translation
:source: The source file name from which the AST was generated
Expand Down Expand Up @@ -69,7 +69,7 @@ def __init__(self, ast: ast_components.InternalFortranAst, source: str, use_expe
ast_internal_classes.Allocate_Stmt_Node: self.allocate2sdfg,
ast_internal_classes.Break_Node: self.break2sdfg,
}
self.use_experimental_cfg_blocks = use_experimental_cfg_blocks
self.use_explicit_cf = use_explicit_cf

def get_dace_type(self, type):
"""
Expand Down Expand Up @@ -271,7 +271,7 @@ def forstmt2sdfg(self, node: ast_internal_classes.For_Stmt_Node, sdfg: SDFG, cfg
:param sdfg: The SDFG to which the node should be translated
"""

if not self.use_experimental_cfg_blocks:
if not self.use_explicit_cf:
declloop = False
name = "FOR_l_" + str(node.line_number[0]) + "_c_" + str(node.line_number[1])
begin_state = ast_utils.add_simple_state_to_sdfg(self, cfg, "Begin" + name)
Expand Down Expand Up @@ -1103,7 +1103,7 @@ def create_sdfg_from_string(
source_string: str,
sdfg_name: str,
normalize_offsets: bool = False,
use_experimental_cfg_blocks: bool = False
use_explicit_cf: bool = False
):
"""
Creates an SDFG from a fortran file in a string
Expand Down Expand Up @@ -1133,7 +1133,7 @@ def create_sdfg_from_string(

program = ast_transforms.ForDeclarer().visit(program)
program = ast_transforms.IndexExtractor(program, normalize_offsets).visit(program)
ast2sdfg = AST_translator(own_ast, __file__, use_experimental_cfg_blocks)
ast2sdfg = AST_translator(own_ast, __file__, use_explicit_cf)
sdfg = SDFG(sdfg_name)
ast2sdfg.top_level = program
ast2sdfg.globalsdfg = sdfg
Expand All @@ -1148,11 +1148,11 @@ def create_sdfg_from_string(
sdfg.parent_sdfg = None
sdfg.parent_nsdfg_node = None
sdfg.reset_cfg_list()
sdfg.using_experimental_blocks = use_experimental_cfg_blocks
sdfg.using_explicit_control_flow = use_explicit_cf
return sdfg


def create_sdfg_from_fortran_file(source_string: str, use_experimental_cfg_blocks: bool = False):
def create_sdfg_from_fortran_file(source_string: str, use_explicit_cf: bool = False):
"""
Creates an SDFG from a fortran file
:param source_string: The fortran file name
Expand Down Expand Up @@ -1180,11 +1180,11 @@ def create_sdfg_from_fortran_file(source_string: str, use_experimental_cfg_block

program = ast_transforms.ForDeclarer().visit(program)
program = ast_transforms.IndexExtractor(program).visit(program)
ast2sdfg = AST_translator(own_ast, __file__, use_experimental_cfg_blocks)
ast2sdfg = AST_translator(own_ast, __file__, use_explicit_cf)
sdfg = SDFG(source_string)
ast2sdfg.top_level = program
ast2sdfg.globalsdfg = sdfg
ast2sdfg.translate(program, sdfg)

sdfg.using_experimental_blocks = use_experimental_cfg_blocks
sdfg.using_explicit_control_flow = use_explicit_cf
return sdfg
7 changes: 3 additions & 4 deletions dace/frontend/python/interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def program(f: F,
recompile: bool = True,
distributed_compilation: bool = False,
constant_functions=False,
use_experimental_cfg_blocks=True,
use_explicit_cf=True,
**kwargs) -> Callable[..., parser.DaceProgram]:
"""
Entry point to a data-centric program. For methods and ``classmethod``s, use
Expand All @@ -69,8 +69,7 @@ def program(f: F,
not depend on internal variables are constant.
This will hardcode their return values into the
resulting program.
:param use_experimental_cfg_blocks: If True, makes use of experimental CFG blocks susch as loop and conditional
regions.
:param use_explicit_cfl: If True, makes use of explicit control flow constructs.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
:param use_explicit_cfl: If True, makes use of explicit control flow constructs.
:param use_explicit_cf: If True, makes use of explicit control flow constructs.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed

:note: If arguments are defined with type hints, the program can be compiled
ahead-of-time with ``.compile()``.
"""
Expand All @@ -87,7 +86,7 @@ def program(f: F,
regenerate_code=regenerate_code,
recompile=recompile,
distributed_compilation=distributed_compilation,
use_experimental_cfg_blocks=use_experimental_cfg_blocks)
use_explicit_cf=use_explicit_cf)


function = program
Expand Down
8 changes: 4 additions & 4 deletions dace/frontend/python/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ def __init__(self,
recompile: bool = True,
distributed_compilation: bool = False,
method: bool = False,
use_experimental_cfg_blocks: bool = True):
use_explicit_cf: bool = True):
from dace.codegen import compiled_sdfg # Avoid import loops

self.f = f
Expand All @@ -176,7 +176,7 @@ def __init__(self,
self.recreate_sdfg = recreate_sdfg
self.regenerate_code = regenerate_code
self.recompile = recompile
self.use_experimental_cfg_blocks = use_experimental_cfg_blocks
self.use_explicit_cf = use_explicit_cf
self.distributed_compilation = distributed_compilation

self.global_vars = _get_locals_and_globals(f)
Expand Down Expand Up @@ -494,10 +494,10 @@ def _parse(self, args, kwargs, simplify=None, save=False, validate=False) -> SDF
# Obtain DaCe program as SDFG
sdfg, cached = self._generate_pdp(args, kwargs, simplify=simplify)

if not self.use_experimental_cfg_blocks:
if not self.use_explicit_cf:
for nsdfg in sdfg.all_sdfgs_recursive():
sdutils.inline_control_flow_regions(nsdfg)
sdfg.using_experimental_blocks = self.use_experimental_cfg_blocks
sdfg.using_explicit_control_flow = self.use_explicit_cf

sdfg.reset_cfg_list()

Expand Down
2 changes: 1 addition & 1 deletion dace/sdfg/analysis/schedule_tree/sdfg_to_tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -652,7 +652,7 @@ def as_schedule_tree(sdfg: SDFG, in_place: bool = False, toplevel: bool = True)
#############################

# Create initial tree from CFG
if sdfg.using_experimental_blocks:
if sdfg.using_explicit_control_flow:
cfg: cf.ControlFlow = cf.structured_control_flow_tree_with_regions(sdfg, lambda _: '')
else:
cfg: cf.ControlFlow = cf.structured_control_flow_tree(sdfg, lambda _: '')
Expand Down
2 changes: 1 addition & 1 deletion dace/sdfg/analysis/writeset_underapproximation.py
Original file line number Diff line number Diff line change
Expand Up @@ -685,7 +685,7 @@ class UnderapproximateWritesDict:
Tuple[SDFGState, SDFGState, List[SDFGState], str, subsets.Range]] = field(default_factory=dict)


@transformation.experimental_cfg_block_compatible
@transformation.explicit_cf_compatible
class UnderapproximateWrites(ppl.Pass):

# Dictionary mapping each edge to a copy of the memlet of that edge with its write set underapproximated.
Expand Down
1 change: 0 additions & 1 deletion dace/sdfg/infer_types.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# Copyright 2019-2021 ETH Zurich and the DaCe authors. All rights reserved.
from collections import defaultdict
from dace import data, dtypes
from dace.codegen.tools import type_inference
from dace.memlet import Memlet
from dace.sdfg import SDFG, SDFGState, nodes, validation
from dace.sdfg import nodes
Expand Down
2 changes: 1 addition & 1 deletion dace/sdfg/propagation.py
Original file line number Diff line number Diff line change
Expand Up @@ -744,7 +744,7 @@ def propagate_states(sdfg: 'SDFG', concretize_dynamic_unbounded: bool = False) -
:note: This operates on the SDFG in-place.
"""

if sdfg.using_experimental_blocks:
if sdfg.using_explicit_control_flow:
# Avoid cyclic imports
from dace.transformation.pass_pipeline import Pipeline
from dace.transformation.passes.analysis import StatePropagation
Expand Down
12 changes: 1 addition & 11 deletions dace/sdfg/replace.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
from dace import dtypes, properties, symbolic
from dace.codegen import cppunparse
from dace.frontend.python.astutils import ASTFindReplace
from dace.sdfg.state import ConditionalBlock, LoopRegion

if TYPE_CHECKING:
from dace.sdfg.state import StateSubgraphView
Expand Down Expand Up @@ -203,13 +202,4 @@ def replace_datadesc_names(sdfg: 'dace.SDFG', repl: Dict[str, str]):
edge.data.data = repl[edge.data.data]

# Replace in loop or branch conditions:
if isinstance(cf, LoopRegion):
replace_in_codeblock(cf.loop_condition, repl)
if cf.update_statement:
replace_in_codeblock(cf.update_statement, repl)
if cf.init_statement:
replace_in_codeblock(cf.init_statement, repl)
elif isinstance(cf, ConditionalBlock):
for c, _ in cf.branches:
if c is not None:
replace_in_codeblock(c, repl)
cf.replace_meta_accesses(repl)
Loading
Loading