Skip to content

Conversation

@reidenong
Copy link
Contributor

@reidenong reidenong commented Jan 28, 2026

  1. Implements unique reference tracking to references in the JIT Optimizer.
  2. Uses the unique reference tracking to eliminate unnecessary reference counting for uniquely referenced tuples. ex:
x, y, z = f()

Some notes:

  • Only implements the unique reference tracking (and relevant optimization) for tuples in _BUILD_TUPLE, to be extended to other objects in the future
  • Objects are deemed as not uniquely referenced when they are made aliases or duplicated, in uops of _LOAD_FAST_* and _COPY.

Would appreciate any feedback.
Thanks

@reidenong
Copy link
Contributor Author

reidenong commented Jan 28, 2026

Discussed with @Fidget-Spinner, will reopen the PR after implementing PyStackRef_CLOSE_SPECIALIZED for _UNPACK_SEQUENCE_UNIQUE_TUPLE

@reidenong reidenong marked this pull request as draft January 28, 2026 18:38
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