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: division safemath when divisor is a literal #2173

Merged
merged 1 commit into from
Sep 29, 2020

Conversation

iamdefinitelyahuman
Copy link
Contributor

What I did

Remove the safemath check when dividing by a literal value.

How I did it

If the divisor is a literal, remove the clamp_nonzero instruction within the LLL.

How to verify it

Run tests.

Cute Animal Picture

image

@codecov-commenter
Copy link

codecov-commenter commented Sep 29, 2020

Codecov Report

Merging #2173 into master will increase coverage by 0.01%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2173      +/-   ##
==========================================
+ Coverage   85.22%   85.23%   +0.01%     
==========================================
  Files          83       83              
  Lines        8330     8336       +6     
  Branches     2009     2011       +2     
==========================================
+ Hits         7099     7105       +6     
  Misses        731      731              
  Partials      500      500              
Impacted Files Coverage Δ
vyper/parser/expr.py 77.04% <100.00%> (+0.28%) ⬆️

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 1b7a215...c3bfd17. Read the comment docs.

@fubuloubu fubuloubu merged commit 332a025 into vyperlang:master Sep 29, 2020
@iamdefinitelyahuman iamdefinitelyahuman deleted the optimize-safemath branch September 29, 2020 19:18
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