Skip to content

Commit

Permalink
fix[venom]: clean up sccp pass (#4261)
Browse files Browse the repository at this point in the history
small cleanup tasks for sccp pass. remove dead variables and stray
comments.
  • Loading branch information
charles-cooper committed Sep 28, 2024
1 parent e2f6001 commit b83bc98
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions vyper/venom/passes/sccp/sccp.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,15 +59,12 @@ class SCCP(IRPass):
cfg_in_exec: dict[IRBasicBlock, OrderedSet[IRBasicBlock]]

cfg_dirty: bool
# list of basic blocks whose cfg_in was modified
cfg_in_modified: OrderedSet[IRBasicBlock]

def __init__(self, analyses_cache: IRAnalysesCache, function: IRFunction):
super().__init__(analyses_cache, function)
self.lattice = {}
self.work_list: list[WorkListItem] = []
self.cfg_dirty = False
self.cfg_in_modified = OrderedSet()

def run_pass(self):
self.fn = self.function
Expand All @@ -76,8 +73,6 @@ def run_pass(self):
self._calculate_sccp(self.fn.entry)
self._propagate_constants()

# self._propagate_variables()

if self.cfg_dirty:
self.analyses_cache.force_analysis(CFGAnalysis)
self._fix_phi_nodes()
Expand Down Expand Up @@ -312,9 +307,6 @@ def _replace_constants(self, inst: IRInstruction):
inst.operands = [target]

self.cfg_dirty = True
for bb in inst.parent.cfg_out:
if bb.label == target:
self.cfg_in_modified.add(bb)

elif inst.opcode in ("assert", "assert_unreachable"):
lat = self._eval_from_lattice(inst.operands[0])
Expand Down

0 comments on commit b83bc98

Please sign in to comment.