numba / numba-rvsdg

Numba compatible RVSDG (Regionalized Value State Dependence Graph) utilities.
https://numba-rvsdg.readthedocs.io/
BSD 2-Clause "Simplified" License
18 stars 7 forks source link

Refactor: Remove `ByteFlow` and `FlowInfo` classes. #75

Open kc611 opened 1 year ago

kc611 commented 1 year ago

As titled,

The ByteFlow and FlowInfo classes can be removed to reduce complexity. All of the methods of the classes can either be made part of the SCFG object or can be made into a function rather than a part of the class.

esc commented 1 year ago

The additional bit is that the Python bytecode itself can be stored as metadata on the PythonByteCode blocks. This will allow those classes to be removed entirely.

I think that the ideal API would be:

scfg = SCFG.from_python_function(python_func)

Or:

scfg = SCFG(python_func)

Also, this means, the ByteFlowRenderer can be removed too because PythonBytecodeBlocks will have the bytecode embedded and as such contain all the information they need to supply to be rendered.