Skip to content

Commit

Permalink
Merge branch 'master' into chore/deployable_source_map
Browse files Browse the repository at this point in the history
  • Loading branch information
charles-cooper authored May 9, 2024
2 parents f7c8bc4 + 4a0305a commit 1ef6e63
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 22 deletions.
18 changes: 0 additions & 18 deletions vyper/venom/passes/make_ssa.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,24 +67,6 @@ def _place_phi(self, var: IRVariable, basic_block: IRBasicBlock):

basic_block.insert_instruction(IRInstruction("phi", args, var), 0)

def _add_phi(self, var: IRVariable, basic_block: IRBasicBlock) -> bool:
for inst in basic_block.instructions:
if inst.opcode == "phi" and inst.output is not None and inst.output.name == var.name:
return False

args: list[IROperand] = []
for bb in basic_block.cfg_in:
if bb == basic_block:
continue

args.append(bb.label)
args.append(var)

phi = IRInstruction("phi", args, var)
basic_block.instructions.insert(0, phi)

return True

def _rename_vars(self, basic_block: IRBasicBlock):
"""
Rename variables. This follows the placement of phi nodes.
Expand Down
5 changes: 1 addition & 4 deletions vyper/venom/passes/mem2var.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,7 @@ def _process_alloca_var(self, dfg: DFGAnalysis, var: IRVariable):
inst.operands = [IRVariable(var_name)]
elif inst.opcode == "return":
bb = inst.parent
new_var = self.function.get_next_variable()
idx = bb.instructions.index(inst)
bb.insert_instruction(
IRInstruction("mstore", [IRVariable(var_name), inst.operands[1]], new_var),
idx,
IRInstruction("mstore", [IRVariable(var_name), inst.operands[1]]), idx
)
inst.operands[1] = new_var

0 comments on commit 1ef6e63

Please sign in to comment.