RFR: 8288421: IGV: warn user about all unreachable nodes

Roberto Castañeda Lozano rcastanedalo at openjdk.java.net
Wed Jun 15 09:12:16 UTC 2022


This changeset ensures that, when approximating C2's schedule, IGV does not schedule unreachable nodes. Instead, a node warning is emitted, informing the user that the corresponding node is unreachable. This information can be useful when debugging ill-formed graphs.

The following clustered subgraph illustrates the proposed change:

![before-after](https://user-images.githubusercontent.com/8792647/173784252-5fccb80b-7c36-49bf-8c52-eed502cc129c.png)

Currently _(before)_, `522 IfFalse` gets assigned the same block as `256 Region` (`B11`) in an effort to schedule as many nodes as possible, and hence no warning is emitted for `522 IfFalse`, even though it is clearly control-unreachable (since it is a child of `520 If` which is control-unreachable). This changeset _(after)_ leaves instead `522 IfFalse` unscheduled and emits a "Control-unreachable CFG node" warning for it (visible as a tooltip of the node warning sign).

As a side-benefit, the changeset simplifies the IGV scheduling algorithm by removing the code that tries to schedule unrechable nodes code on a best-effort basis, and adds two additional node warnings ("Region with multiple successors" and "CFG node without control successors") to highlight the new nodes that might remain unscheduled as a consequence. 

#### Testing

- Tested manually on the [graph](https://bugs.openjdk.org/secure/attachment/99555/graph.xml) attached to the JBS issue.

- Tested automatically that scheduling tens of thousands of graphs (by instrumenting IGV to schedule parsed graphs eagerly and running `java -Xcomp -XX:-TieredCompilation -XX:PrintIdealGraphLevel=4`) does trigger any exception or assertion failure.

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

Commit messages:
 - Do not schedule unreachable CFG nodes, warn instead

Changes: https://git.openjdk.org/jdk/pull/9164/files
 Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=9164&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8288421
  Stats: 91 lines in 1 file changed: 11 ins; 79 del; 1 mod
  Patch: https://git.openjdk.org/jdk/pull/9164.diff
  Fetch: git fetch https://git.openjdk.org/jdk pull/9164/head:pull/9164

PR: https://git.openjdk.org/jdk/pull/9164


More information about the hotspot-compiler-dev mailing list