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]: new DFTPass algorithm #4255

Draft
wants to merge 140 commits into
base: master
Choose a base branch
from

Conversation

harkal
Copy link
Collaborator

@harkal harkal commented Sep 24, 2024

What I did

I upgraded the DFT algorithm to allow for more instruction movement and performs "multidimensional" fencing. It also removes the use of order ids and sorting.

How I did it

How to verify it

Commit message

This commit implements a new `DFTPass` to handle instruction grouping and 
ordering based on dependencies. This new algorithm ensures that instructions 
are processed in a dependency-first traversal manner as groups but also
individually, with handling of instruction effects dependencies.

Description for the changelog

Cute Animal Picture

image-4

harkal and others added 30 commits September 18, 2024 10:21
temp

more stack2mem

exception and usage

mem allocator

tests and fixes to allocator

fixes

lint allocator

more

stack top method

allocator fixes

lint

fixes and update tests

plug memory allocator

add types

cleanup and lint

exceptions handling
this commit adds a small heuristic for cleaning the input stack from
cfg_in, which is to pop the shallowest items first.

it also cleans up the code a little bit and adds stronger preconditions
to the code.

a further optimization would be to try to align the output stack as best
as possible at the jnz, but that belongs in the DFT pass.
vyper/venom/passes/dft.py Fixed Show fixed Hide fixed
if write_effect in last_write_effects and last_write_effects[write_effect] != inst:
self.barriers[inst].add(last_write_effects[write_effect])
if write_effect in last_read_effects:
self.barriers[inst].add(last_read_effects[write_effect])
Copy link
Member

@charles-cooper charles-cooper Oct 18, 2024

Choose a reason for hiding this comment

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

maybe some way to do it without the loop? e.g.

self.barriers[inst] |= (write_effects & last_read_effects)

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.

2 participants