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]: move dfs order to CFGAnalysis #4330

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

Conversation

charles-cooper
Copy link
Member

@charles-cooper charles-cooper commented Oct 25, 2024

What I did

move dfs order calculation from domtree to cfg analysis.

remove unnecessary calculation of domtree in sccp

remove redundant IRFunction.compute_reachability

change cfg_out order

refactor shared phi fixup code

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 marked this pull request as ready for review October 25, 2024 17:49
Copy link

codecov bot commented Oct 25, 2024

Codecov Report

Attention: Patch coverage is 29.78723% with 33 lines in your changes missing coverage. Please review.

Project coverage is 46.13%. Comparing base (063f190) to head (78da77c).

Files with missing lines Patch % Lines
vyper/venom/analysis/cfg.py 24.00% 19 Missing ⚠️
vyper/venom/function.py 16.66% 5 Missing ⚠️
vyper/venom/analysis/dominators.py 62.50% 3 Missing ⚠️
vyper/venom/passes/simplify_cfg.py 0.00% 2 Missing ⚠️
vyper/venom/venom_to_assembly.py 33.33% 2 Missing ⚠️
vyper/venom/analysis/liveness.py 0.00% 1 Missing ⚠️
vyper/venom/passes/sccp/sccp.py 50.00% 1 Missing ⚠️

❗ There is a different number of reports uploaded between BASE (063f190) and HEAD (78da77c). Click for more details.

HEAD has 97 uploads less than BASE
Flag BASE (063f190) HEAD (78da77c)
98 1
Additional details and impacted files
@@             Coverage Diff             @@
##           master    #4330       +/-   ##
===========================================
- Coverage   91.30%   46.13%   -45.18%     
===========================================
  Files         112      112               
  Lines       15921    15916        -5     
  Branches     2691     2684        -7     
===========================================
- Hits        14537     7343     -7194     
- Misses        949     8018     +7069     
- Partials      435      555      +120     

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

@@ -1,8 +1,7 @@
from typing import Iterator, Optional

from vyper.codegen.ir_node import IRnode
from vyper.utils import OrderedSet
from vyper.venom.basicblock import CFG_ALTERING_INSTRUCTIONS, IRBasicBlock, IRLabel, IRVariable
from vyper.venom.basicblock import IRBasicBlock, IRLabel, IRVariable

Check failure

Code scanning / CodeQL

Module-level cyclic import Error

'IRBasicBlock' may not be defined if module
vyper.venom.basicblock
is imported before module
vyper.venom.function
, as the
definition
of IRBasicBlock occurs after the cyclic
import
of vyper.venom.function.
@@ -1,8 +1,7 @@
from typing import Iterator, Optional

from vyper.codegen.ir_node import IRnode
from vyper.utils import OrderedSet
from vyper.venom.basicblock import CFG_ALTERING_INSTRUCTIONS, IRBasicBlock, IRLabel, IRVariable
from vyper.venom.basicblock import IRBasicBlock, IRLabel, IRVariable

Check failure

Code scanning / CodeQL

Module-level cyclic import Error

'IRLabel' may not be defined if module
vyper.venom.basicblock
is imported before module
vyper.venom.function
, as the
definition
of IRLabel occurs after the cyclic
import
of vyper.venom.function.
@@ -1,8 +1,7 @@
from typing import Iterator, Optional

from vyper.codegen.ir_node import IRnode
from vyper.utils import OrderedSet
from vyper.venom.basicblock import CFG_ALTERING_INSTRUCTIONS, IRBasicBlock, IRLabel, IRVariable
from vyper.venom.basicblock import IRBasicBlock, IRLabel, IRVariable

Check failure

Code scanning / CodeQL

Module-level cyclic import Error

'IRVariable' may not be defined if module
vyper.venom.basicblock
is imported before module
vyper.venom.function
, as the
definition
of IRVariable occurs after the cyclic
import
of vyper.venom.function.
@charles-cooper charles-cooper marked this pull request as draft October 26, 2024 22:26
@charles-cooper charles-cooper marked this pull request as ready for review October 27, 2024 02:25
@charles-cooper charles-cooper requested review from harkal and removed request for harkal October 27, 2024 15:19
@@ -308,7 +314,7 @@ def _generate_evm_for_basicblock_r(

ref.extend(asm)

for bb in basicblock.reachable:
for bb in basicblock.cfg_out:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could be reachable removed from basic block if it is no longer used here?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, good point

Copy link
Member Author

Choose a reason for hiding this comment

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

@charles-cooper
Copy link
Member Author

hmm, this creates a regression in branch_storm.vy

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