- This commit first adds a stack of bytecode positions within the
ByteCodeExecutor. This is needed because in pdl_interp.choose_range,
we iterate over a range of operands/values from a list of permutations
returned by pdl_interp.get_permutations until we reach finalize. When
we reach finalize, we need to return back to the position marked in the
stack.
- Then a functionality to extend the lifetime of values that cross the
nondeterministic choice is added. The existing bytecode generator
allocates the values to memory positions by representing the liveness of
values as a collection of disjoint intervals over the matcher positions.
This is akin to register allocation, and substantially reduces the
footprint of the bytecode executor. However, because with
nondeterministic op pdl_interp.choose_range, execution "returns" back,
so any values whose original liveness cross the nondeterminstic choice
must have their lifetime executed until finalize.
- Then, lowerings of pdl_interp.choose_range, pdl_interp.get_item,
pdl_interp.get_permutations, and pdl_interp.is_commutative ops to
bytecode is added.
Co-authors: Srishti Srivastava, Stanislav Funiak, Prateek Gupta
Signed-off-by: Srishti Srivastava <srishti.srivastava@polymagelabs.com>
The range-of-ranges use case seems parallel to operation ranges above. Now that pdl_interp.foreach does not mutate the range (of operations/ranges) it iterates over, can we replace
with
?