4 ms·
This sort of visualization would be nice for LLVM IR! The Go implementation is located here: https://github.com/golang/go/blob/master/src/cmd/compile/internal/g
by jevinskie 10y ago
This sort of visualization would be nice for LLVM IR! The Go implementation is located here: https://github.com/golang/go/blob/master/src/cmd/compile/internal/gc/ssa.go https://github.com/golang/go/blob/master/src/cmd/compile/int...
- qznc 10y agoWhy not use a proper graph? http://pp.ipd.kit.edu/firm/GraphSnippets http://pp.ipd.kit.edu/firm/GraphSnippets
- jevinskie 10y agoIs SSA form not already a proper graph? I would agree that the visualization would benefit from a toggle between pure textual representation and one that includes the graph structure with textual basic blocks. LLVM already has graphviz output so perhaps a dot2html utility with some SSA smarts added would do the trick.
- jasonwatkinspdx 10y agoBecause the boxes and arrows style visualization becomes a horrific mess quite quickly when dealing with anything beyond toy examples. Look at the diagram for a 4 line for loop in your link, then think about what a 200 line function looks like.
- qznc 10y agoI do use the tool which created the images for large functions (100.000 nodes was the max) and with zoom, search, etc it is fine. With graphviz it sucks, though. Unfortunately, our yComp tool is not Free Software. http://pp.ipd.kit.edu/firm/yComp http://pp.ipd.kit.edu/firm/yComp
- chewxy 10y agoBecause you will end up with unwieldly graphs like these: https://twitter.com/chewxy/status/433807908875145216 https://twitter.com/chewxy/status/433807908875145216 https://twitter.com/chewxy/status/433811541373116416 https://twitter.com/chewxy/status/433811541373116416 This is from an old JITting Javascript engine I wrote in Go... a simple program like this: function clamp(x, min, max) { y = 2 if (x < min) { x = min } else if (x > max) { x = max } return x } can generate pngs that are thousands of pixels wide and high (depending on what the nodesep and ranksep were set). I wish I did think of the visualization that Go uses. That's fantastic compared to graphs
- qznc 10y agoGraphviz/dot sucks. Here is yComp for the same function: https://imgur.com/a/5eP9k https://imgur.com/a/5eP9k The blocks and red edges represent the control flow graph and I can easily see the two if structures. It lets you zoom. Mouseover nodes to get more details.
- pcwalton 10y ago-print-after-all combined with the graphviz visualizer is very loosely similar.