Skip to content

Commit

Permalink
Filter split instruction blocks when generating the SFSs
Browse files Browse the repository at this point in the history
  • Loading branch information
alexcere committed Oct 9, 2024
1 parent 3929f59 commit 1140db2
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/liveness/layout_generation.py
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,9 @@ def _construct_code_from_block_list(self):
json_info[block_name] = block_specification

successors = [possible_successor for possible_successor in
[current_block.get_jump_to(), current_block.get_falls_to()] if possible_successor is not None]
[current_block.get_jump_to(), current_block.get_falls_to()]
if possible_successor is not None]

for successor in successors:
if successor not in traversed:
heapq.heappush(pending_blocks, (self._block_depth[successor], real_depth + 1, successor))
Expand All @@ -362,6 +364,15 @@ def build_layout(self):
self._block_list.blocks})

nx.nx_agraph.write_dot(renamed_graph, Path(self._dir.parent).joinpath(self._dir.stem + "_stacks.dot"))

# Skip blocks with split instructions in the JSON information. We must remove
# then at this point because their specification is needed to generate the "_stacks" dot file
split_blocks = set(block_name for block_name, block in self._block_list.blocks.items()
if block.get_jump_type() == "split_instruction_block")

json_info = {json_name: sfs for json_name, sfs in json_info.items()
if any(json_name in split_block for split_block in split_blocks)}

return json_info


Expand Down

0 comments on commit 1140db2

Please sign in to comment.