Goal: collect a list of useful functions that can be used in debugger. These functions should be simple and easy to read, so that other developers can adapt them to their individual need, should they have a more specific use case.
Process: collect ideas, and implementations. Then discuss, and select what is broadly helpful.
Initial ideas:
1) traverse cfg (control flow graph) backwards/upwards, printing all cfg nodes. Verify if we ever reach the start node. This can be helpful to find out if the IR graph region is dead.
2) traverse phi graph (or dataflow in general). See if it is a dead loop (no dataflow ever enters).
3) find shortest path between to nodes. Could be helpful to see how/if the nodes are related. Maybe there are even better queries that check for relatedness of 2 nodes?
3a) Find node in transitive inputs. Filter options: only cfg, only phi. Display shortest path found that way.