Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GH-120024: Change LOAD_FAST instructions to LOAD_FAST_TEMP when it is guaranteed the reference is consumed immediately. #125192

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

markshannon
Copy link
Member

@markshannon markshannon commented Oct 9, 2024

This PR adds a LOAD_FAST_TEMP instruction for loading locals to the evaluation stack that are used as short-lived values within an expression. Distinguishing these LOAD_FAST instructions will allow us to avoid expensive reference counting operations in these cases.

This is marked as draft, as it has no value until the default build supports reference counts in tags.

The stats show that 3/4 of all LOAD_FAST (including the LOAD_FASTs in LOAD_FAST_LOAD_FAST) are converted to LOAD_FAST_TEMP.

Before merging, a few tests need fixing and the choice of superinstructions needs updating.

@markshannon markshannon changed the title Mark load fast deferred for guaranteed consumed refs GH-120024: Change LOAD_FAST instructions to LOAD_FAST_TEMP when it is guaranteed the reference is consumed immediately. Oct 9, 2024
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.

1 participant