From: Jacob Lifshay Date: Tue, 6 Dec 2022 07:21:49 +0000 (-0800) Subject: add pack=true attribute to graphviz graph X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=153b17db0807c990026f29f27cecdbf79a8f60d2;p=bigint-presentation-code.git add pack=true attribute to graphviz graph --- diff --git a/src/bigint_presentation_code/_tests/test_register_allocator.py b/src/bigint_presentation_code/_tests/test_register_allocator.py index 7db0796..9cf6270 100644 --- a/src/bigint_presentation_code/_tests/test_register_allocator.py +++ b/src/bigint_presentation_code/_tests/test_register_allocator.py @@ -264,6 +264,7 @@ class TestRegisterAllocator(unittest.TestCase): self.assertEqual(graphs, { 'initial': 'graph {\n' + ' graph [pack = true]\n' ' "0" [label = ">: 0"]\n' ' "1" [label = ">: 0"]\n' ' "2" [label = ">: 0"]\n' diff --git a/src/bigint_presentation_code/register_allocator.py b/src/bigint_presentation_code/register_allocator.py index 6e7d87c..94de331 100644 --- a/src/bigint_presentation_code/register_allocator.py +++ b/src/bigint_presentation_code/register_allocator.py @@ -474,7 +474,10 @@ class InterferenceGraph: # both directions if edge_key not in edges and edge_key[::-1] not in edges: edges[edge_key] = edge - lines = ["graph {"] + lines = [ + "graph {", + " graph [pack = true]", + ] for node, node_id in node_ids.items(): label_lines = [] # type: list[str] for k, v in node.merged_ssa_val.ssa_val_offsets.items():