RFR: 8309463: IGV: Dynamic graph layout algorithm [v5]
Christian Hagedorn
chagedorn at openjdk.org
Thu Aug 24 10:55:36 UTC 2023
On Thu, 24 Aug 2023 08:59:58 GMT, emmyyin <duke at openjdk.org> wrote:
>> I still don't understand why you need `n.vertex == null` here. If `n.vertex != null`, then the loop continuation test `n.vertex == null && found` will be false and we will not perform another iteration.
>
> Exactly, if `n.vertex == null` we want to break the loop. There are two cases we need to consider when removing the dummy nodes: 1) there is a long chain of dummy nodes between node u and v, and 2) the edge is part of an edge concentration of multiple edges. In case 1) we just traverse the edge with all the dummy nodes and remove them as we go until we hit node u (`n.vertex != null`). In case 2) we traverse along the edge until we find the anchor node (which is a dummy node with one ingoing edge and multiple outgoing edges), and break the loop when we reach the anchor node. The `found` variable is to ensure the dummy node is actually connected to something. Not sure if that part is actually needed
Thanks for explaining it in more details. We probably had a misunderstanding here, though. Toby and I were referring to this `n.vertex == null` here:
if (n.vertex == null && n.succs.size() <= 1 && n.preds.size() <= 1)
and not the one in
while (n.vertex == null && found)
>From your explanation it makes sense to keep the one in the `while` but the other one in the `if` always seems to be true and could thus be removed.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/14349#discussion_r1304150782
More information about the hotspot-compiler-dev
mailing list