Skip to content

Conversation

@Lunderberg
Copy link
Contributor

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.

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.
@vinx13 vinx13 merged commit 108a4e1 into apache:main Aug 28, 2024
@Lunderberg Lunderberg deleted the relax_remove_tuple_round_trip_in_canonicalize_bindings branch August 29, 2024 14:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants