Open sklam opened 1 year ago
Sample implementation used in Numba RVSDG frontend: https://github.com/numba/numba/blob/edfc1b95bf633abb346fbbe265acf2bb20560a6e/numba/core/frontend2/regionpasses.py
RegionVisitor and RegionTransformers enables a hierarchical thinking for compiler pass implementation. This simplifies compiler passes to just 3 abstract methods:
RegionVisitor
RegionTransformers
visit_block()
visit_loop()
visit_switch()
Sample implementation used in Numba RVSDG frontend: https://github.com/numba/numba/blob/edfc1b95bf633abb346fbbe265acf2bb20560a6e/numba/core/frontend2/regionpasses.py
RegionVisitor
andRegionTransformers
enables a hierarchical thinking for compiler pass implementation. This simplifies compiler passes to just 3 abstract methods:visit_block()
: handle a purely data-dependence block in RVSDG.visit_loop()
: handle a loop region.visit_switch()
: handle a switch region.