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

fix: assembly dead code eliminator #3791

Merged
merged 4 commits into from
Feb 20, 2024

Conversation

charles-cooper
Copy link
Member

it was not aggressive enough, and could leave some instructions which mangle the assembly so it can't be turned into bytecode

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-->

it was not aggressive enough, and could leave some instructions which
mangle the assembly so it can't be turned into bytecode
@codecov-commenter
Copy link

codecov-commenter commented Feb 20, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (2d2a682) 84.99% compared to head (2be68d7) 84.97%.
Report is 4 commits behind head on master.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3791      +/-   ##
==========================================
- Coverage   84.99%   84.97%   -0.03%     
==========================================
  Files          92       92              
  Lines       13717    13733      +16     
  Branches     3079     3078       -1     
==========================================
+ Hits        11659    11669      +10     
- Misses       1570     1576       +6     
  Partials      488      488              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Collaborator

@harkal harkal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't it be advantageous to modify the code so that it begins searching for the end condition once a terminal instruction is detected, and then deletes the entire code chunk at once? This approach appears -IMO- easier to follow, and more efficient since we only delete once for every chunk, rather than for every instruction within the chunk.

Moreover, we might consider transitioning to a 'walk and mark' technique, which identifies used instructions and eliminates all dead code. While it may not significantly impact Venom-emitted assembly, it could potentially improve the efficiency of the current intermediate representation (IR).

@charles-cooper
Copy link
Member Author

Wouldn't it be advantageous to modify the code so that it begins searching for the end condition once a terminal instruction is detected, and then deletes the entire code chunk at once? This approach appears -IMO- easier to follow, and more efficient since we only delete once for every chunk, rather than for every instruction within the chunk.

Moreover, we might consider transitioning to a 'walk and mark' technique, which identifies used instructions and eliminates all dead code. While it may not significantly impact Venom-emitted assembly, it could potentially improve the efficiency of the current intermediate representation (IR).

69d0372

@charles-cooper charles-cooper marked this pull request as ready for review February 20, 2024 13:08
@charles-cooper charles-cooper enabled auto-merge (squash) February 20, 2024 13:08
@charles-cooper charles-cooper merged commit d8d98c2 into vyperlang:master Feb 20, 2024
84 checks passed
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.

3 participants