Skip to content

Commit

Permalink
invalidate the dfg
Browse files Browse the repository at this point in the history
  • Loading branch information
charles-cooper committed Oct 13, 2024
1 parent c93d13c commit efcbc21
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
3 changes: 0 additions & 3 deletions vyper/venom/analysis/dfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,6 @@ def remove_use(self, op: IRVariable, inst: IRInstruction):
uses = self._dfg_inputs.get(op, [])
uses.remove(inst)

def remove_var(self, op: IRVariable):
self._dfg_outputs.pop(op)

@property
def outputs(self) -> dict[IRVariable, IRInstruction]:
return self._dfg_outputs
Expand Down
2 changes: 1 addition & 1 deletion vyper/venom/passes/remove_unused_variables.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ def run_pass(self):
self._process_instruction(inst)

self.analyses_cache.invalidate_analysis(LivenessAnalysis)
self.analyses_cache.invalidate_analysis(DFGAnalysis)

def _process_instruction(self, inst):
if inst.output is None:
Expand All @@ -42,5 +43,4 @@ def _process_instruction(self, inst):
new_uses = self.dfg.get_uses(operand)
self.work_list.addmany(new_uses)

self.dfg.remove_var(inst.output)
inst.parent.remove_instruction(inst)

0 comments on commit efcbc21

Please sign in to comment.