Skip to content

Commit

Permalink
reverse order
Browse files Browse the repository at this point in the history
  • Loading branch information
charles-cooper committed Sep 24, 2024
1 parent 83e2b31 commit 71a92dc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions vyper/venom/passes/algebraic_optimization.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,10 @@ def _handle_offsets(self):
if inst.opcode != "add":
continue
ops = inst.operands
if isinstance(ops[0], IRLabel):
if isinstance(ops[1], IRLabel):
# add is commutative
ops.reverse()
if isinstance(ops[0], IRLiteral) and isinstance(ops[1], IRLabel):
if isinstance(ops[1], IRLiteral) and isinstance(ops[0], IRLabel):
inst.opcode = "offset"

def run_pass(self):
Expand Down

0 comments on commit 71a92dc

Please sign in to comment.