from numba_rvsdg.core.datastructures.ast_transforms import AST2SCFGTransformer
def branch(b: int) -> int:
if b:
r = 1
else:
r = 2
return r
scfg = AST2SCFGTransformer(branch).transform_to_SCFG()
scfg.restructure()
scfg.view()
This produced the following:
As you can see the jump targets of both the region branch_region_0 and basic block 1 have been updated to read tail_region_0 but the jump targets of region branch_region_1 and basic block 2 have not! The updates should be symmetric. The same code path is taken for both branch regions, yet two different results are produced. What is going on here?
Code to reproduce:
This produced the following:
As you can see the
jump targets
of both the regionbranch_region_0
and basic block1
have been updated to readtail_region_0
but thejump targets
of regionbranch_region_1
and basic block2
have not! The updates should be symmetric. The same code path is taken for both branch regions, yet two different results are produced. What is going on here?