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

refactor[venom]: use InstUpdater in more passes #4508

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

charles-cooper
Copy link
Member

What I did

it's safer and faster for passes which modify the dfg to modify it in place using InstUpdater

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

@charles-cooper charles-cooper changed the title refactor[venom]: use InstUpdater everywhere refactor[venom]: use InstUpdater in more passes Mar 10, 2025
Copy link

codecov bot commented Mar 10, 2025

Codecov Report

Attention: Patch coverage is 97.29730% with 3 lines in your changes missing coverage. Please review.

Project coverage is 92.15%. Comparing base (ded6b2c) to head (810a06a).

Files with missing lines Patch % Lines
vyper/venom/analysis/dfg.py 93.33% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4508      +/-   ##
==========================================
- Coverage   92.16%   92.15%   -0.02%     
==========================================
  Files         122      122              
  Lines       17471    17467       -4     
  Branches     2959     2957       -2     
==========================================
- Hits        16103    16097       -6     
- Misses        957      958       +1     
- Partials      411      412       +1     

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

@charles-cooper charles-cooper requested review from harkal and HodanPlodky and removed request for harkal March 11, 2025 11:30
@@ -14,6 +14,7 @@ class RemoveUnusedVariablesPass(IRPass):

def run_pass(self):
self.dfg = self.analyses_cache.request_analysis(DFGAnalysis)
self.updater = InstUpdater
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should not this consume the dfg/call constructor?

Copy link
Member Author

Choose a reason for hiding this comment

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

hm, looks like it's not actually used

Copy link
Member Author

Choose a reason for hiding this comment

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

@@ -1,7 +1,7 @@
from vyper.utils import OrderedSet, uniq
from vyper.venom.analysis import DFGAnalysis, LivenessAnalysis
from vyper.venom.basicblock import IRInstruction
from vyper.venom.passes.base_pass import IRPass
from vyper.venom.passes.base_pass import InstUpdater, IRPass

Check notice

Code scanning / CodeQL

Unused import Note

Import of 'InstUpdater' is not used.
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