tvm
tvm copied to clipboard
[Relax] Identify tuple unpack/repack in CanonicalizeBindings
Prior to this commit, the CanonicalizeBindings pass could identify and simplify a value that had been packed into a tuple, then extracted from it. (e.g. Simplifying tup = (x,y); z = tup[0] into z = x.) However, it could not identify a value that had been expanded from a tuple, and then re-bundled. (e.g. Simplifying new_tuple = (tup[0], tup[1]) into new_tuple = tup.)
This commit updates CanonicalizeBindings to identify and remove unnecessary tuple unpacking/repacking.