Skip to content

Commit

Permalink
simplify some code
Browse files Browse the repository at this point in the history
  • Loading branch information
charles-cooper committed Nov 12, 2024
1 parent 446d6f3 commit bd50da8
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions vyper/venom/function.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,21 +98,16 @@ def remove_unreachable_blocks(self) -> int:
if not bb.is_reachable:
removed.add(bb)

for bb in removed:
self.remove_basic_block(bb)

# Remove phi instructions that reference removed basic blocks
for bb in self.get_basic_blocks():
modified = False
for in_bb in list(bb.cfg_in):
if in_bb not in removed:
continue

modified = True
bb.remove_cfg_in(in_bb)

if modified or True:
bb.fix_phi_instructions()
# TODO: only run this if cfg_in changed
bb.fix_phi_instructions()

return len(removed)

Expand Down

0 comments on commit bd50da8

Please sign in to comment.