Open
Description
def udt(i):
while i < 10:
if i > 2:
s = 123
i += 1
return s
numba-rvsdg/numba_rvsdg/core/datastructures/scfg.py:734: in restructure
self.restructure_loop()
numba-rvsdg/numba_rvsdg/core/datastructures/scfg.py:712: in restructure_loop
restructure_loop(self.region)
numba-rvsdg/numba_rvsdg/core/transformations.py:269: in restructure_loop
loop_restructure_helper(scfg, loop)
numba-rvsdg/numba_rvsdg/core/transformations.py:34: in loop_restructure_helper
headers, entries = scfg.find_headers_and_entries(loop)
numba-rvsdg/numba_rvsdg/core/datastructures/scfg.py:393: in find_headers_and_entries
headers = {self.find_head()}
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = SCFG(graph={'1': PythonASTBlock(name='1', _jump_targets=('2', '3'), backedges=(), begin=-1, end=-1, tree=[<ast.Compare..._region_0', _jump_targets=(), backedges=(), kind='meta', parent_region=None, header=None, subregion=..., exiting=None))
def find_head(self) -> str:
"""Finds the head block of the SCFG.
Assuming the SCFG is closed, this will find the block
that no other blocks are pointing to.
Returns
-------
head: str
Name of the head block of the graph.
"""
heads = set(self.graph.keys())
for name in self.graph.keys():
block = self.graph[name]
for jt in block.jump_targets:
heads.discard(jt)
> assert len(heads) == 1
E AssertionError
Metadata
Metadata
Assignees
Labels
No labels
Activity