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

Optimization for multiple memory-zeroing instructions #2174

Merged
merged 1 commit into from
Sep 30, 2020

Conversation

iamdefinitelyahuman
Copy link
Contributor

What I did

Add an optimization for zeroing multiple memory slots at once.

Closes #2144

How I did it

When the LLL contains multiple sequential instructions to MSTORE n 0 or CALLDATACOPY m CALLDATALSIZE n, and the locations being zero'd within memory are sequential, merge these instructions into a single zeroing via calldatacopy.

How to verify it

Run tests.

Cute Animal Picture

image

@codecov-commenter
Copy link

codecov-commenter commented Sep 29, 2020

Codecov Report

Merging #2174 into master will increase coverage by 0.04%.
The diff coverage is 96.66%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2174      +/-   ##
==========================================
+ Coverage   85.25%   85.29%   +0.04%     
==========================================
  Files          83       83              
  Lines        8367     8397      +30     
  Branches     2019     2029      +10     
==========================================
+ Hits         7133     7162      +29     
  Misses        732      732              
- Partials      502      503       +1     
Impacted Files Coverage Δ
vyper/optimizer.py 83.33% <96.66%> (+3.92%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0b5669d...e1c195f. Read the comment docs.

@fubuloubu fubuloubu merged commit 928ba7f into vyperlang:master Sep 30, 2020
@iamdefinitelyahuman iamdefinitelyahuman deleted the optimize-mzero branch September 30, 2020 16:33
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.

Optimize zero-value memory variable declarations using CALLDATACOPY
3 participants