-
-
Notifications
You must be signed in to change notification settings - Fork 803
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]: avoid last swap
for commutative ops
#4048
feat[venom]: avoid last swap
for commutative ops
#4048
Conversation
swap
avoidance for commutative ops
vyper/venom/passes/dft.py
Outdated
@@ -40,7 +40,7 @@ def _process_instruction_r(self, bb: IRBasicBlock, inst: IRInstruction, offset: | |||
self.inst_order[inst] = 0 | |||
return | |||
|
|||
for op in inst.get_inputs(): | |||
for op in list(inst.get_input_variables()): |
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.
iterator doesn't work?
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.
i'd prefer to just inspect the inputs and see which one is top of stack, but this works (and it may support more stack optimizations in the future)
swap
avoidance for commutative opsswap
for commutative ops
What I did
Commutative op aware scheduling
How I did it
How to verify it
Commit message
Description for the changelog
Cute Animal Picture