This PR is part of my GSoC project.
This implement ConditionalRegion, a ControlFlowRegion which similarly to LoopRegion implements the the if else construct. Additionally it rewrites the inlining system for all cfgs (dace/sdfg/region_inline.py). I refactored the inlining functions so that each function is going to inline the region and recursively inline of all its children. This allows the loop region inliner function to catch all the break and continue states inside of it and handle them.
It also adds the ReturnState, a SDFGState which represents a return statement.
Needs confirmation
The else branch is stored in a ControlFlowRegion as a Property of ConditionalRegion. This can lead to all sorts of bugs if some algorithm visits conditional regions as control flow region because it won't find the else branch. In my opinion this problem can be mitigated by not making ConditionalRegion a subclass of ControlFlowRegion but it will contain two ControlFlowRegions: a main branch and an else branch. So when visiting that region you have to explicitly visit both the main and else branches.
The new inliners are not transformation.MultiStateTransformation anymore. They are just functions.
It still not supporting if and for inside each other.
This PR is part of my GSoC project. This implement ConditionalRegion, a ControlFlowRegion which similarly to LoopRegion implements the the if else construct. Additionally it rewrites the inlining system for all cfgs (
dace/sdfg/region_inline.py
). I refactored the inlining functions so that each function is going to inline the region and recursively inline of all its children. This allows the loop region inliner function to catch all the break and continue states inside of it and handle them. It also adds the ReturnState, a SDFGState which represents a return statement.Needs confirmation
ControlFlowRegion
as aProperty
ofConditionalRegion
. This can lead to all sorts of bugs if some algorithm visits conditional regions as control flow region because it won't find the else branch. In my opinion this problem can be mitigated by not makingConditionalRegion
a subclass ofControlFlowRegion
but it will contain twoControlFlowRegion
s: a main branch and an else branch. So when visiting that region you have to explicitly visit both the main and else branches.transformation.MultiStateTransformation
anymore. They are just functions.