-
-
Notifications
You must be signed in to change notification settings - Fork 804
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]: memory write merging #4341
base: master
Are you sure you want to change the base?
Conversation
looking very nice |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #4341 +/- ##
==========================================
- Coverage 91.31% 88.52% -2.79%
==========================================
Files 113 114 +1
Lines 16061 16238 +177
Branches 2703 2742 +39
==========================================
- Hits 14666 14375 -291
- Misses 964 1334 +370
- Partials 431 529 +98 ☔ View full report in Codecov by Sentry. |
change the signature to dst, src, length as it mirrors the opcodes
vyper/venom/passes/memmerging.py
Outdated
return a < b | ||
|
||
def overlap(self, other: "_Interval") -> bool: | ||
a = max(self.src_start, other.src_end) |
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.
a = max(self.src_start, other.src_end) | |
a = max(self.src_start, other.src_start) |
vyper/venom/passes/memmerging.py
Outdated
intervals.clear() | ||
|
||
def _add_interval( | ||
self, intervals: list[_Interval], new_inter: _Interval, ok_dst_overlap: bool = False |
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.
Maybe use a better name for ok_dst_overlap
? Something like allow_dst_overlap_src
would be more self explanatory. I would pair that with changing the dst_overlap
to dst_overlaps_src()
vyper/venom/passes/memmerging.py
Outdated
intervals.insert(index, new_inter) | ||
if index > 0: | ||
if intervals[index - 1].overlap(new_inter): | ||
return False |
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.
Shouldn't we be removing the interval we just added here? Or do the insert after the checks?
What I did
Reimplementation of methods from original pipeline optimizer into the venom pipeline, that handled merging of the multiple memory operations that writes into the continuous chuck of the memory into one instruction that does in batch.
How I did it
Created new pass for this purpose
How to verify it
I have written new tests
Commit message
feat[venom]: venom pipeline memory coalescing
Commit message for the final, squashed PR. (Optional, but reviewers will appreciate it! Please see our commit message style guide for what we would ideally like to see in a commit message.)
Description for the changelog
Cute Animal Picture