Add if extraction transformation
As part of the series of SDFG rewriting transformations, IfExtraction targets nested SDFGs that begin with an if statement whose condition is independent of symbols defined or updated in the outer state (these are either writes to arrays or definitions in maps). The if is "extracted": the outers state is duplicated and a new if guard is created in the outer SDFG with the appropriately translated condition. If the edges contain symbol definitions these become definitions in the nested SDFG symbol_mapping.
Example of application:
becomes:
Agreeing with @phschaad here - tests for when this applies and when it does not apply are needed. Apart from that, it LGTM.
In general happy to accept this, but we need at least one or two unit tests
Added more unit tests, added more explanation. PTAL.
Thank you for continuing this @pratyai :-) As with #1639, I would prefer to briefly discuss this in the DaCe meeting before accepting, for the same reasons listed in #1639. However, in general this looks good and I am happy to add this contribution to DaCe.
Leaving a note here to revisit this transformation for slight adaptation after https://github.com/spcl/dace/pull/1676 is merged.