Skip to content

refactor[venom]: refactor sccp pass to use dfg#4329

Merged
charles-cooper merged 3 commits intovyperlang:masterfrom
HodanPlodky:sccp_dfg_use
Oct 25, 2024
Merged

refactor[venom]: refactor sccp pass to use dfg#4329
charles-cooper merged 3 commits intovyperlang:masterfrom
HodanPlodky:sccp_dfg_use

Conversation

@HodanPlodky
Copy link
Copy Markdown
Collaborator

@HodanPlodky HodanPlodky commented Oct 25, 2024

What I did

used DFGAnalysis in SCCP instead of the computing the uses in the SCCP itself

How I did it

Remove computation from the SCCP and added DFG analysis into it and changed the DFG analysis so it uses OrderedSet

How to verify it

Commit message

use `DFGAnalysis` in `SCCP` instead of duplicating the logic to compute
uses in the `SCCP` itself. also use `OrderedSet` for var uses, this
ensures we don't add the same instruction multiple times (as in `add
%2 %2`) to a var's use set, and also enables a cheaper `remove_use()`
implementation.

Cute Animal Picture

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

@charles-cooper charles-cooper changed the title Sccp dfg use refactor[venom]: refactor sccp pass to use dfg Oct 25, 2024
@@ -67,14 +67,16 @@ def __init__(self, analyses_cache: IRAnalysesCache, function: IRFunction):
def run_pass(self):
self.fn = self.function
self.dom = self.analyses_cache.request_analysis(DominatorTreeAnalysis)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

i was looking at this and i think technically we don't even need dominator analysis, we just use it for dfs walk

@charles-cooper charles-cooper merged commit 658f0c4 into vyperlang:master Oct 25, 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