-
-
Notifications
You must be signed in to change notification settings - Fork 871
feat[venom]: add multi-output instruction support for stack-based calling convention #4747
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
base: master
Are you sure you want to change the base?
feat[venom]: add multi-output instruction support for stack-based calling convention #4747
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #4747 +/- ##
==========================================
- Coverage 93.27% 93.23% -0.05%
==========================================
Files 137 137
Lines 19455 19616 +161
Branches 3361 3399 +38
==========================================
+ Hits 18146 18288 +142
- Misses 888 903 +15
- Partials 421 425 +4 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
vyper/venom/basicblock.py
Outdated
|
|
||
| inst = IRInstruction("invoke", inst_args, ret) | ||
| inst = IRInstruction("invoke", inst_args, single_output) | ||
| if extra_outputs: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
check is not None
charles-cooper
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice work.
couple comments about the approach:
- why split the outputs into output + extra_outputs? seems like it would be cleaner to just have a list
- i think the use of truthy for
outsis going to lead to a lot of trouble since it doesn't distinguish between None and the empty list -- ex. https://github.com/vyperlang/vyper/pull/4747/files#r2476313719
HodanPlodky
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suppose this is expected but just for sake of it not being forgotten, there is a small codesize regression in cases where the return values needs to be stored in memory after the call. Before this PR it could be done in the internal function it self but if the value is returned in stack then it needs to be done after every invoke. But I found at most 8 bytes of difference (in vault). Other than this note, it seems nice
What I did
Extent Venom to support multi-output instructions and implemented a multi-output
invokefor functions that return multiple values.How I did it
How to verify it
Commit message
Description for the changelog
Cute Animal Picture