Skip to content

feat[venom]: add load elimination pass#4265

Merged
charles-cooper merged 23 commits intovyperlang:masterfrom
charles-cooper:feat/load-elimination
Dec 20, 2024
Merged

feat[venom]: add load elimination pass#4265
charles-cooper merged 23 commits intovyperlang:masterfrom
charles-cooper:feat/load-elimination

Conversation

@charles-cooper
Copy link
Copy Markdown
Member

@charles-cooper charles-cooper commented Sep 29, 2024

What I did

How I did it

How to verify it

Commit message

add primitive `sload`/`tload`/`mload` elimination. keeps latest
(m/s/t)load or (m/s/t)store in a one-element "lattice", and weakens the
(m/s/t)load to a `store` instruction if there is a hit on the same key.

Description for the changelog

Cute Animal Picture

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

@codecov
Copy link
Copy Markdown

codecov bot commented Oct 19, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.99%. Comparing base (fadd4de) to head (352b10f).
Report is 66 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4265      +/-   ##
==========================================
- Coverage   91.74%   89.99%   -1.76%     
==========================================
  Files         118      119       +1     
  Lines       16581    16615      +34     
  Branches     2789     2796       +7     
==========================================
- Hits        15213    14953     -260     
- Misses        936     1172     +236     
- Partials      432      490      +58     

☔ 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.

@charles-cooper charles-cooper marked this pull request as ready for review November 23, 2024 11:04
@charles-cooper charles-cooper self-assigned this Dec 17, 2024

if inst.opcode == "mstore":
# mstore [val, ptr]
memory = (inst.operands[1], inst.operands[0])
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Could we just switch it so the order in which the value and ptr is store we cannot always switch them (just to make it simple to reason about it)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

i think the reason i wrote it like that is to kind of hint at a future implementation with lattice (mapping locations to values), it will look like

val, ptr = inst.operands
memory[ptr] = val

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

i rewrote it a bit so that we don't have to look at the reversal of the indexes
6faffba

@charles-cooper charles-cooper enabled auto-merge (squash) December 20, 2024 19:54
@charles-cooper charles-cooper changed the title feat[venom]: add load elimination feat[venom]: add load elimination pass Dec 20, 2024
@charles-cooper charles-cooper merged commit 9c98b3e into vyperlang:master Dec 20, 2024
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