Skip to content

feat[venom]: add assert optimizer#4585

Merged
charles-cooper merged 2 commits intovyperlang:masterfrom
charles-cooper:feat/revert-to-assert
Apr 17, 2025
Merged

feat[venom]: add assert optimizer#4585
charles-cooper merged 2 commits intovyperlang:masterfrom
charles-cooper:feat/revert-to-assert

Conversation

@charles-cooper
Copy link
Copy Markdown
Member

this pass adds a revert-to-assert pass, which detects patterns where we jnz into a block which simply does revert 0, 0, and optimizes that into an assert, which is better for instruction reordering.

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

this pass adds a revert-to-assert pass, which detects patterns where we
`jnz` into a block which simply does `revert 0, 0`, and optimizes that
into an `assert`, which is better for instruction reordering.
@charles-cooper charles-cooper enabled auto-merge (squash) April 17, 2025 22:13
@charles-cooper charles-cooper merged commit e4e9d7c into vyperlang:master Apr 17, 2025
159 checks passed
@charles-cooper charles-cooper deleted the feat/revert-to-assert branch April 17, 2025 22:14
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 17, 2025

Codecov Report

Attention: Patch coverage is 97.36842% with 1 line in your changes missing coverage. Please review.

Project coverage is 92.68%. Comparing base (79001f3) to head (775e9f7).
Report is 78 commits behind head on master.

Files with missing lines Patch % Lines
vyper/venom/passes/revert_to_assert.py 97.22% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4585      +/-   ##
==========================================
+ Coverage   92.64%   92.68%   +0.04%     
==========================================
  Files         122      123       +1     
  Lines       17530    17575      +45     
  Branches     2980     2988       +8     
==========================================
+ Hits        16240    16289      +49     
+ Misses        892      888       -4     
  Partials      398      398              

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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