RFR: 8260653: Unreachable nodes keep speculative types alive [v2]

Nils Eliasson neliasso at openjdk.java.net
Wed Feb 17 14:35:59 UTC 2021


> The RunThese test fails because after first igvn.optimize() (directly after parsing) there are unreachable nodes cycles left. Later when remove_speculative_types() is called - only reachable nodes will have their speculative type removed. At the end of remove_speculative_types() there is an assert that all speculative types have been removed that will fail.
> 
> This problem will not cause crashes in production - it is only a sanity test.
> 
> I suggest adding a call to PhaseRemoveUseless before remove_speculative_types. This will cost a few extra cycles but it is the only way we can guarantee that no unreachable nodes are left.
> 
> When debugging this I experimented with adding a call to verify_graph_edges to check for dead code at the same spot. This triggers failures in a lot of test. The conclusion is that it is very common that we have dead node cycles - but they very rarely keep speculative types alive.
> 
> A big thank you to Dean Long how created the reproducer for this bug.
> 
> Please review.

Nils Eliasson has updated the pull request incrementally with one additional commit since the last revision:

  Check if node is live before assert

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

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/2606/files
  - new: https://git.openjdk.java.net/jdk/pull/2606/files/5f279179..82ab1066

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=2606&range=01
 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=2606&range=00-01

  Stats: 10 lines in 2 files changed: 6 ins; 3 del; 1 mod
  Patch: https://git.openjdk.java.net/jdk/pull/2606.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/2606/head:pull/2606

PR: https://git.openjdk.java.net/jdk/pull/2606


More information about the hotspot-compiler-dev mailing list