-
-
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]: optimize branching #4049
feat[venom]: optimize branching #4049
Conversation
moved the pass one step up so it does not need to delete instructions, they just become unused and the `RemoveUnusedVariablesPass` does the work
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #4049 +/- ##
==========================================
- Coverage 91.01% 88.63% -2.39%
==========================================
Files 106 107 +1
Lines 15387 15326 -61
Branches 3384 3369 -15
==========================================
- Hits 14005 13584 -421
- Misses 948 1231 +283
- Partials 434 511 +77 ☔ View full report in Codecov by Sentry. |
use it to optimize branch optimizer
@@ -22,6 +22,10 @@ def get_uses(self, op: IRVariable) -> list[IRInstruction]: | |||
def get_producing_instruction(self, op: IRVariable) -> Optional[IRInstruction]: | |||
return self._dfg_outputs.get(op) | |||
|
|||
def add_use(self, op: IRVariable, inst: IRInstruction): | |||
uses = self._dfg_inputs.setdefault(op, []) | |||
uses.append(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.
note: this could be out of order from recalculating dfg from scratch, maybe in the future we should use something like set()
or OrderedSet()
for uses
What I did
Added a pass to optimize inefficient branches
How I did it
How to verify it
Commit message
Description for the changelog
Cute Animal Picture