vyper icon indicating copy to clipboard operation
vyper copied to clipboard

feat[venom]: optimize branching

Open harkal opened this issue 1 year ago • 1 comments

What I did

Added a pass to optimize inefficient branches

How I did it

How to verify it

Commit message

This commit introduces a new pass called `BranchOptimizationPass` 
that optimizes inefficient branches.

More specifically, when a branch is led with a logic inversion `ISZERO` 
we remove the `ISZERO` and invert the branch targets.

Description for the changelog

Cute Animal Picture

      /\_/\  
     ( o.o ) 
      > ^ <   "Please?"

harkal avatar May 24 '24 07:05 harkal

Codecov Report

Attention: Patch coverage is 94.73684% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 88.63%. Comparing base (96a8384) to head (1f7a792).

:exclamation: Current head 1f7a792 differs from pull request most recent head c329834

Please upload reports for the commit c329834 to get more accurate results.

Files Patch % Lines
vyper/venom/passes/branch_optimization.py 94.11% 0 Missing and 1 partial :warning:
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4049      +/-   ##
==========================================
- Coverage   91.01%   88.63%   -2.39%     
==========================================
  Files         106      107       +1     
  Lines       15387    15326      -61     
  Branches     3384     3369      -15     
==========================================
- Hits        14005    13584     -421     
- Misses        948     1231     +283     
- Partials      434      511      +77     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar May 24 '24 12:05 codecov[bot]