Alternative layout engine for CFGs #5886
Replies: 3 comments 4 replies
-
Such layout is the result of pruning DAG edges into a tree, than recursively adjusting each block subtree to the right. We can relatively easily switch to the more compact left approach ('parent in the middle of bounds') but frankly I'm not entirely happy with either. ========================================== Which I personally prefer. The layout is compact yet easy to follow, blocks that add in br/select have added info at the bottom (including outgoing arrows from the right label) and more. The edges can be customized to be more similar to the existing CFG by or One apparent downside is that backedges target the bottom of the dest-block and not its top. This is somewhat-solvable with the edge attribute To generate the .dot from IR you use
and see the results either offline -
or paste the .dot contents into http://magjac.com/graphviz-visual-editor/ or https://viz-js.com/ or similar. =====================================================
My guess is the added backend burden isn't substantial, but this is a medium+ size project - so I really hope to collect some opinions before going there. @jeremy-rifkin WDYT? |
Beta Was this translation helpful? Give feedback.
-
For IR CFGs the |
Beta Was this translation helpful? Give feedback.
-
@OfekShilon I think the solution here would be to do layout compacting, possibly in addition to placing the parent between children, as outlined in the cutter docs This has been on the backlog and one of the big remaining things I've wanted to implement. We could definitely have an option for a graphviz layout. Personally I haven't been a big fan of graphviz layouts for this type of thing because I don't think it handles edges well. For example, edges coming out of different sides of a block in the |
Beta Was this translation helpful? Give feedback.
-
Describe the bug
In the example below the block
sw.epilog
is needlessly aligned to the right. This is a rather common phenomena, and fixing it would make the graphs nicer.Steps to reproduce
https://godbolt.org/z/ocTW1xxa4
Expected behavior
Centered CFG graphs, with as much of the flow as possible concentrated in a single view.
Reproduction link
https://godbolt.org/z/ocTW1xxa4
Screenshots
Operating System
No response
Browser version
No response
Beta Was this translation helpful? Give feedback.
All reactions