Skip to content

fix[venom]: fix sccp resolution of truthy jnz#4505

Merged
charles-cooper merged 9 commits intovyperlang:masterfrom
charles-cooper:fix/sccp-traversal
Mar 11, 2025
Merged

fix[venom]: fix sccp resolution of truthy jnz#4505
charles-cooper merged 9 commits intovyperlang:masterfrom
charles-cooper:fix/sccp-traversal

Conversation

@charles-cooper
Copy link
Copy Markdown
Member

@charles-cooper charles-cooper commented Mar 8, 2025

What I did

see commit message

How I did it

How to verify it

see the unit tests

Commit message

this commit fixes SCCP traversal - when a jnz has a truthy condition
that is not equal to 1, it gets transformed to a `jmp`, however, during
lattice construction, both branches are explored and therefore some
phis are suboptimally resolved to BOTTOM, even though they can
theoretically be resolved to a proper value since one of the input bbs
will actually be pruned from the CFG.

this issue is *not* visible in the regular pipeline, since SCCP is run
multiple times and thus the phis get resolved after the second SCCP run.
however, it is visible in tests, and would be visible in the regular
pipeline if SCCP were only run one time.

this commit also removes a `FlowWorkItem` addition, which is redundant
since all the cfg altering instructions are already handled in
`_visit_expr`.

Description for the changelog

Cute Animal Picture

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

this commit fixes SCCP traversal - when a jnz has a truthy condition
that is not equal to 1, it gets transformed to a `jmp`, however, during
lattice construction, both branches are explored and therefore some
phis are suboptimally resolved to BOTTOM, even though they can
theoretically be resolved to a proper value since one of the input bbs
will actually be pruned from the CFG.

this issue is *not* visible in the regular pipeline, since SCCP is run
multiple times and thus the phis get resolved after the second SCCP run.
however, it is visible in tests, and would be visible in the regular
pipeline if SCCP were only run one time.

this commit also removes a `FlowWorkItem` addition, which is redundant
since all the cfg altering instructions are already handled in
`_visit_expr`.
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 8, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.16%. Comparing base (eb2efa3) to head (95ffecc).
Report is 87 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #4505   +/-   ##
=======================================
  Coverage   92.16%   92.16%           
=======================================
  Files         122      122           
  Lines       17475    17471    -4     
  Branches     2962     2959    -3     
=======================================
- Hits        16105    16103    -2     
+ Misses        958      957    -1     
+ Partials      412      411    -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 enabled auto-merge (squash) March 11, 2025 15:04
@charles-cooper charles-cooper merged commit fbcf7d2 into vyperlang:master Mar 11, 2025
159 checks passed
@charles-cooper charles-cooper deleted the fix/sccp-traversal branch March 11, 2025 15:23
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