Skip to content

Commit

Permalink
slight cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
charles-cooper committed Nov 22, 2024
1 parent 0478878 commit 4f20568
Showing 1 changed file with 6 additions and 12 deletions.
18 changes: 6 additions & 12 deletions vyper/venom/passes/function_inliner.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,21 +93,15 @@ def _handle_invoke(self, invoke_inst, invoke_idx):
if inst.opcode == "param":
inst.opcode = "store"
inst.operands = [invoke_inst.operands[-i-1]]
if inst.opcode == "alloca":
alloca_id = inst.operands[0]
#assert alloca_id not in self._alloca_map, (alloca_id, inst, fn, target_function)
if alloca_id in self._alloca_map:
inst.opcode = "store"
#inst.operands = self._alloca_map[alloca_id].

# remap variable output
if inst.output is not None:
if inst.output in var_map:
# this can happen because we are not in SSA yet.
inst.output = var_map[inst.output]
if inst.output not in var_map:
var_map[inst.output] = fn.get_next_variable()
else:
new_var = fn.get_next_variable()
var_map[inst.output] = new_var
inst.output = new_var
# this can happen because we are not in SSA yet.
pass
inst.output = var_map[inst.output]

fn.append_basic_block(new_bb)
self.worklist.append(new_bb)
Expand Down

0 comments on commit 4f20568

Please sign in to comment.