RFR: 8372451: C2 SuperWord: "endless loop" assert. Need to implement proper worklist mechanism

Emanuel Peter epeter at openjdk.org
Thu Nov 27 11:45:23 UTC 2025


On Wed, 26 Nov 2025 16:02:20 GMT, Emanuel Peter <epeter at openjdk.org> wrote:

> **Context**: `VTransform::optimize`. Works a bit like IGVN, it allows each node to perform optimizations. Recently introduced during JDK26.
> 
> **Problem**: I made the assumption that we don't need a worklist mechanism, we can just do multiple passes over all nodes. The assumption was that there would not be any "trickling" of updates over the graph. But that is wrong: for example we can have a long chain of dead nodes, and we need to progressively remove the last node and mark it as dead.
> 
> **Solution**: Implement proper worklist mechanism, so that updates can trickle over the graph.

src/hotspot/share/opto/vtransform.cpp line 45:

> 43: // This is similar to IGVN optimization. But we are a bit lazy, and don't care about
> 44: // notification / worklist, since the list of nodes is rather small, and we don't
> 45: // expect optimizations that trickle over the whole graph.

This was wrong: we did have have a "trickle" over the graph with a chain of dead nodes, progressively realizing that the last node in the link was dead.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/28512#discussion_r2567733145


More information about the hotspot-compiler-dev mailing list