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]: improve liveness computation #4301

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

charles-cooper
Copy link
Member

traversing in reverse topsort order improves stack scheduling slightly (codesize improvement of about 0.35%)

this commit also adds a topsort method to CFGAnalysis, and speeds it up by only checking the terminator instruction instead of iterating over all the instructions in every basic block.

What I did

How I did it

How to verify it

Commit message

Commit message for the final, squashed PR. (Optional, but reviewers will appreciate it! Please see our commit message style guide for what we would ideally like to see in a commit message.)

Description for the changelog

Cute Animal Picture

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

traversing in reverse topsort order improves stack scheduling slightly
(codesize improvement of about 0.35%)

this commit also adds a topsort method to CFGAnalysis, and speeds it up
by only checking the terminator instruction instead of iterating over
all the instructions in every basic block.
@charles-cooper charles-cooper marked this pull request as draft October 14, 2024 15:48
@charles-cooper
Copy link
Member Author

marking as draft since this seems to introduce a scheduler regression elsewhere 😱

tests/functional/codegen/features/test_immutable.py:237: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

...

vyper/venom/venom_to_assembly.py:597: in dup
    assembly.append(_evm_dup_for(depth))
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

depth = -16

    def _evm_dup_for(depth: int) -> str:
        dup_idx = 1 - depth
        if not (1 <= dup_idx <= 16):
>           raise StackTooDeep(f"Unsupported dup depth {dup_idx}")
E           vyper.exceptions.StackTooDeep: Unsupported dup depth 17
E           
E           This is an unhandled internal compiler error. Please create an issue on Github to notify the developers!
E           https://github.com/vyperlang/vyper/issues/new?template=bug.md

vyper/venom/venom_to_assembly.py:616: StackTooDeep

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