-
-
Notifications
You must be signed in to change notification settings - Fork 793
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]: common subexpression elimination pass #4241
base: master
Are you sure you want to change the base?
Conversation
class _Expression: | ||
first_inst : IRInstruction | ||
opcode: str | ||
operands : list[IROperand] |
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.
looks like this can be IROperand | _Expression
Co-authored-by: Charles Cooper <[email protected]>
…ar fix Co-authored-by: Charles Cooper <[email protected]>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #4241 +/- ##
===========================================
- Coverage 91.36% 45.91% -45.45%
===========================================
Files 108 110 +2
Lines 15637 15859 +222
Branches 3440 3496 +56
===========================================
- Hits 14287 7282 -7005
- Misses 920 8024 +7104
- Partials 430 553 +123
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
if inst in _UNINTERESTING_OPCODES: | ||
continue | ||
inst_expr = self.available_expression_analysis.get_expression(inst) | ||
avail = self.available_expression_analysis.get_available(inst) |
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.
How about get_available()
doing directly returning the first_inst
if there is one or None
and avoid the need to use get_expression()
before?
self.data[inst] = OrderedSet() | ||
|
||
|
||
_UNINTERESTING_OPCODES = ["store", "param", "offset", "phi", "nop"] |
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.
Move this up to the top of the file and make public?
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.
Add some comments on the code to make easier to follow, and explain some of the quirks.
What I did
Created common subexpression elimination pass
How I did it
Created available expression analysis and common subexpressions elimination pass. The available expression analysis is done with consideration to effects which heavy inspired by multidimensional fencing.
How to verify it
Created tests
Commit message
feat[venom]: common subexpression elimination
Cute Animal Picture