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[venom]: add function inliner #4478

Merged
merged 48 commits into from
Feb 21, 2025

Conversation

harkal
Copy link
Collaborator

@harkal harkal commented Feb 18, 2025

What I did

How I did it

How to verify it

Commit message

This commit adds a function inliner to the Venom backend, including:

- A basic heuristic to determine when inlining is beneficial
  (placeholder for future sophisticated analysis)
- new machinery for global (inter-function) passes over Venom IR to
  perform inlining
- A new function call graph analysis to support inlining
- Removal of the variable equivalence analysis (now provided directly by
  DFG analysis)

misc/refactor:
- add new `all2` utility function
- add dfs preorder traversal to CFG
- add ensure_well_formed util to IRBasicBlock
- machinery for IRParameter (may be useful in the future)
- add `copy()` machinery for venom data structures (may be useful in the
  future)

Description for the changelog

Cute Animal Picture

image-13

@harkal harkal force-pushed the feat/venom/inline_pass branch from e98dc17 to 88ddfb0 Compare February 19, 2025 12:25
@harkal harkal force-pushed the feat/venom/inline_pass branch from 5736ee8 to 60a7929 Compare February 19, 2025 12:54
Copy link

codecov bot commented Feb 20, 2025

Codecov Report

Attention: Patch coverage is 87.67773% with 52 lines in your changes missing coverage. Please review.

Project coverage is 91.99%. Comparing base (cd31867) to head (3b15a33).
Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
vyper/venom/basicblock.py 67.85% 18 Missing ⚠️
vyper/venom/function.py 56.66% 13 Missing ⚠️
vyper/venom/analysis/cfg.py 57.14% 9 Missing ⚠️
vyper/venom/context.py 70.00% 6 Missing ⚠️
vyper/venom/passes/function_inliner.py 97.85% 1 Missing and 2 partials ⚠️
vyper/venom/venom_to_assembly.py 71.42% 2 Missing ⚠️
vyper/venom/passes/base_pass.py 88.88% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4478      +/-   ##
==========================================
- Coverage   92.12%   91.99%   -0.13%     
==========================================
  Files         119      120       +1     
  Lines       16962    17292     +330     
  Branches     2872     2930      +58     
==========================================
+ Hits        15626    15908     +282     
- Misses        919      963      +44     
- Partials      417      421       +4     

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

@charles-cooper charles-cooper marked this pull request as ready for review February 20, 2025 13:50
@charles-cooper charles-cooper changed the title feat[venom]: function inliner feat[venom]: add function inliner Feb 20, 2025
Copy link
Collaborator

@cyberthirst cyberthirst left a comment

Choose a reason for hiding this comment

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

just checking legacy part

@charles-cooper charles-cooper merged commit a466dc8 into vyperlang:master Feb 21, 2025
161 of 162 checks passed
@charles-cooper charles-cooper deleted the feat/venom/inline_pass branch February 21, 2025 09:39
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