Shopify / seafoam

A tool for working with compiler graphs dumped by the GraalVM compiler
MIT License
126 stars 22 forks source link

Phi "from" labels reference removed nodes #68

Open DSouzaM opened 1 year ago

DSouzaM commented 1 year ago

On Phi nodes, each incoming data edge is associated with a particular input to the Phi's associated Merge node. Seafoam renders a "from ID" label to denote which branch a value comes from, but sometimes node ID is hidden in the rendered graph.

For example:

image

This graph references nodes 14 and 16, which have been removed from the graph. In this case, these nodes are just End nodes (maybe this is always the case? I'm not familiar with Graal graph invariants):

image

Since these nodes are removed from the graph entirely, we can't simply update the label to reference the End's predecessor. Could we assume the Merge inputs are in the same order as the Phi inputs?

(In any case, not a big blocker for me. I'm content to manually rewrite the .dot files for the small graphs I'm working with.)

chrisseaton commented 1 year ago

Right - thanks we'll fix that.

chrisseaton commented 1 year ago

Sub-task - add an assertion that labels only reference visible nodes.