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

feat[venom]: add extract_literals pass #4067

Merged

Conversation

charles-cooper
Copy link
Member

@charles-cooper charles-cooper commented May 30, 2024

What I did

extract IRLiterals which are instruction arguments; this reduces pressure on the stack scheduler

not sure that this is a good idea, but empirically it seems to work. for example, CurveStableSwapNG-0.4.0.vy goes from from 21849 to 21645 (204 bytes, i.e. 1%)

How I did it

How to verify it

Commit message

extract `IRLiterals` which are instruction arguments; this reduces
pressure on the stack scheduler because `_emit_input_operands` can cause
stack storms when we hit `_stack_reorder`. by extracting them, we allow
`DFTPass` to reorder literal emission in a more optimized way before
even getting to `_emit_input_operands`

Description for the changelog

Cute Animal Picture

Put a link to a cute animal picture inside the parenthesis-->

extract IRLiterals which are instruction arguments; this reduces
pressure on the stack scheduler
@charles-cooper
Copy link
Member Author

but not across the board. snekmate/utils/mocks/math_mock.vy has a performance regression for instance.

@charles-cooper charles-cooper marked this pull request as ready for review May 31, 2024 13:35
@charles-cooper charles-cooper changed the title feat[venom]: extract literals pass feat[venom]: add extract_literals pass May 31, 2024
@charles-cooper charles-cooper merged commit bb9129a into vyperlang:master May 31, 2024
157 checks passed
@charles-cooper charles-cooper deleted the fix/literal-scheduling branch May 31, 2024 15:00
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