Skip to content

Conversation

@harkal
Copy link
Collaborator

@harkal harkal commented Sep 10, 2025

What I did

Extent Venom to support multi-output instructions and implemented a multi-output invoke for functions that return multiple values.

How I did it

How to verify it

Commit message

Implements support for instructions with multiple return values, primarily for
the `invoke` instruction using stack-based return convention. Instructions can
now have multiple outputs via `_outputs` field, with `get_outputs()` and other
helpers.

Key changes:
  - Add `_outputs` field to IRInstruction for multi-output support
  - Fix parser, DFG analysis, and optimisation passes to handle multi-output
  - Update venom-to-assembly to properly manage stack for multi-return invoke
  - Add comprehensive tests for multi-output invoke instructions

Description for the changelog

Cute Animal Picture

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

@codecov
Copy link

codecov bot commented Sep 18, 2025

Codecov Report

❌ Patch coverage is 91.96429% with 27 lines in your changes missing coverage. Please review.
✅ Project coverage is 93.28%. Comparing base (cb8a732) to head (85a9365).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
vyper/venom/check_venom.py 89.70% 6 Missing and 1 partial ⚠️
vyper/venom/basicblock.py 88.88% 4 Missing and 1 partial ⚠️
vyper/venom/passes/dft.py 75.00% 2 Missing and 2 partials ⚠️
vyper/venom/ir_node_to_venom.py 95.16% 2 Missing and 1 partial ⚠️
vyper/venom/function.py 0.00% 2 Missing ⚠️
vyper/venom/parser.py 90.47% 1 Missing and 1 partial ⚠️
...r/venom/passes/common_subexpression_elimination.py 50.00% 1 Missing and 1 partial ⚠️
vyper/venom/analysis/dfg.py 50.00% 1 Missing ⚠️
vyper/venom/venom_to_assembly.py 95.65% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4747      +/-   ##
==========================================
- Coverage   93.30%   93.28%   -0.03%     
==========================================
  Files         137      137              
  Lines       19480    19623     +143     
  Branches     3367     3396      +29     
==========================================
+ Hits        18176    18305     +129     
- Misses        884      894      +10     
- Partials      420      424       +4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

bb.append_instruction("ret", val, label)
ret_vals: list[IROperand] = []
for i in range(k):
if i == 0:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this optimization is actually unnecessary right? will be handled by SCCP/algebraic opts

@charles-cooper charles-cooper enabled auto-merge (squash) November 27, 2025 13:33
@charles-cooper charles-cooper merged commit 3180c36 into vyperlang:master Nov 27, 2025
160 checks passed
@harkal harkal deleted the feat/venom/call_conv_stack_return branch November 27, 2025 17:50
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