Hacker News new | past | comments | ask | show | jobs | submit login

Why not use a proper graph? http://pp.ipd.kit.edu/firm/GraphSnippets



Because you will end up with unwieldly graphs like these:

https://twitter.com/chewxy/status/433807908875145216

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


Graphviz/dot sucks. Here is yComp for the same function: 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.


Because 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.


I 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


Is 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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: