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

feat: add select opcode to LLL #2690

Merged
merged 3 commits into from
Mar 4, 2022

Conversation

charles-cooper
Copy link
Member

@charles-cooper charles-cooper commented Mar 4, 2022

this is an optimizing opcode for ternary operations. this is useful
because even in the presence of perfect liveness analysis, branches
still need to issue more POPs than are required with a specialized
select opcode.

this commit also modifies the min/max to use the new opcode, as an
example.

fixes #2382

h/t to @yaronvel - https://twitter.com/yaron_velner/status/1499461195073568769

What I did

How I did it

How to verify it

tests still pass

Description for the changelog

Cute Animal Picture

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

vyper/lll/README.md Outdated Show resolved Hide resolved
this is an optimizing opcode for ternary operations. this is useful
because even in the presence of perfect liveness analysis, branches
still need to issue more POPs than are required with a specialized
`select` opcode.

this commit also modifies the `min/max` builtins to use the new opcode,
as an example.
@codecov-commenter
Copy link

codecov-commenter commented Mar 4, 2022

Codecov Report

Merging #2690 (89e3022) into master (8fe7f82) will increase coverage by 0.01%.
The diff coverage is 71.42%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2690      +/-   ##
==========================================
+ Coverage   86.27%   86.29%   +0.01%     
==========================================
  Files          91       91              
  Lines        9743     9754      +11     
  Branches     2467     2469       +2     
==========================================
+ Hits         8406     8417      +11     
  Misses        834      834              
  Partials      503      503              
Impacted Files Coverage Δ
vyper/utils.py 87.14% <ø> (ø)
vyper/builtin_functions/functions.py 88.18% <52.94%> (ø)
vyper/lll/compile_lll.py 93.57% <100.00%> (+0.14%) ⬆️

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 8fe7f82...89e3022. Read the comment docs.

@charles-cooper charles-cooper merged commit 323b86a into vyperlang:master Mar 4, 2022
@charles-cooper charles-cooper deleted the lll_select branch March 4, 2022 16:35
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.

new technique for ternary operation
3 participants