RFR: 8283930: IGV: add toggle button to show/hide empty blocks in CFG view

Roberto Castañeda Lozano rcastanedalo at openjdk.java.net
Thu Apr 7 07:00:12 UTC 2022


This change introduces a toggle button to show or hide empty blocks in the control-flow graph view. Showing empty blocks can be useful to provide context, for example when extracting a small set of nodes. On the other hand, for large graphs it can be preferable to hide empty blocks so that the extracted nodes can be localized more easily. Since both modes have advantages or disadvantages, this change gives the user the option to quickly switch between them. The toggle button is only active in the control-flow graph view: empty blocks in the clustered sea-of-nodes view are never shown because they would be disconnected and hence would not provide any additional context.

#### Testing

- Tested manually on a small selection of graphs.

- Tested automatically viewing thousands of graphs with random node subsets extracted, in all four combinations of showing/hiding empty blocks and showing/hiding neighbors of extracted nodes. The automatic test is performed by instrumenting IGV to view graphs and extract nodes randomly as the graphs are loaded, and running `java -Xcomp -XX:-TieredCompilation -XX:PrintIdealGraphLevel=4`.

#### Screenshots

- New toggle button:

![toolbar](https://user-images.githubusercontent.com/8792647/162010086-9d34dab9-4f64-4115-b57a-eb56328c5355.png)

- Example control-flow graph with extracted node (85) and shown empty blocks:

<p align="center">
<img src="https://user-images.githubusercontent.com/8792647/162010182-47c148dd-ba4a-4ed9-9013-c2b29e95f708.png" width="30%">
</p

- Example control-flow graph with the same extracted node and hidden empty blocks:


<p align="center">
<img src="https://user-images.githubusercontent.com/8792647/162010256-7faf7041-e132-4b0a-b2de-828d18c4a7f8.png" width="30%">
</p

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

Commit messages:
 - Add toggle to show empty blocks in CFG view (true by default)

Changes: https://git.openjdk.java.net/jdk/pull/8128/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=8128&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8283930
  Stats: 134 lines in 9 files changed: 101 ins; 15 del; 18 mod
  Patch: https://git.openjdk.java.net/jdk/pull/8128.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/8128/head:pull/8128

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


More information about the hotspot-compiler-dev mailing list