Problem Statement
When compiling programs as
from guppylang import guppy
from guppylang.std.collections import Stack
from guppylang.std.builtins import array
@guppy.struct
class MyStruct:
qb: array[int, 1]
stack: Stack[int, 1]
@guppy.declare
def state_gen() -> MyStruct: ...
@guppy.declare
def state_discard(s: MyStruct @ owned) -> None: ...
@guppy
def wrapper() -> None:
state = state_gen()
state_discard(state)
we do not fully simplify the hugr.
UntuplePass only removes MakeTuple -> UnpackTuple sequence. Also, the pass is not iterative, so MakeTuple -> MakeTuple -> Unpack -> Unpack only removes the internal pair.
Problem Statement
When compiling programs as
we do not fully simplify the hugr.
UntuplePassonly removesMakeTuple -> UnpackTuplesequence. Also, the pass is not iterative, soMakeTuple -> MakeTuple -> Unpack -> Unpackonly removes the internal pair.