Skip to content

Commit

Permalink
lift out prev=var
Browse files Browse the repository at this point in the history
  • Loading branch information
charles-cooper committed Jun 4, 2024
1 parent f89711e commit 7fa84b4
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions vyper/venom/passes/store_expansion.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,19 +34,16 @@ def _process_inst(self, dfg, inst, idx):

insertion_idx = idx + 1

for use_inst in uses[1:]:
prev = var

for use_inst in reversed(uses):
if use_inst.parent != inst.parent:
continue # improves codesize
#pass

#print("ENTER", var)
prev = var
for i, operand in enumerate(use_inst.operands):
if operand == var:
new_var = self.function.get_next_variable()
#print("ENTER2", prev, new_var)
new_inst = IRInstruction("store", [prev], new_var)
#print("ENTER3", new_inst)
inst.parent.insert_instruction(new_inst, insertion_idx)
insertion_idx += 1
use_inst.operands[i] = new_var
Expand Down

0 comments on commit 7fa84b4

Please sign in to comment.