RFR: 8302738: IGV: refine 'Simplify graph' filter [v5]

Roberto Castañeda Lozano rcastanedalo at openjdk.org
Thu Mar 30 16:30:35 UTC 2023


> The "Simplify graph" filter abstracts away details from the graph that are typically unnecessary for debugging or analyzing the represented program. This changeset decouples this filter into two:
> 
> - "Simplify graph", which hides elements that are typically (but not always) unnecessary, and
> - "Condense graph", which makes the graph more compact without loss of information.
> 
> Together, these two filters reduce the average graph size by a factor of 1.6x (nodes) and 1.9x (edges):
> 
> ![without-with-filters](https://user-images.githubusercontent.com/8792647/224118397-e6bd45d1-0b90-4d94-88ae-0a83f9ef20da.png)
> 
> Besides decoupling the "Simplify graph" filter, the changeset extends its functionality by:
> - combining Bool and conversion nodes into their predecessors,
> - inlining all Parm nodes except control into their successors (this removes lots of long edges),
> - removing "top" inputs from call-like nodes,
> - inlining more source nodes (such as MachTemp and ThreadLocal) into their successors,
> - pretty-printing the labels of many inlined and combined nodes such as Bool comparisons or Catch projections (via a new filter that edits node properties), and
> - using a sparse representation of nodes with empty inputs (e.g. call-like nodes after applying "Simplify graph").
> 
> The sparse input representation shows dots between non-contiguous inputs, instead of horizontal space proportional to the number of empty inputs. This helps reducing node width, which is known to improve overall layout quality:
> 
> ![dense-vs-sparse](https://user-images.githubusercontent.com/8792647/224118703-04f663b7-7a73-4e49-87d9-2acd8b98522b.png)
> 
> Note that the exact input indices can still be retrieved via the incoming edge's tooltips:
> 
> ![tooltip-with-input-index](https://user-images.githubusercontent.com/8792647/224119319-7f40fba2-1e9f-436e-a11c-8c3d428d46a6.png)
> 
> The control-flow graph view is also adapted to this representation:
> 
> ![sparse-in-cfg](https://user-images.githubusercontent.com/8792647/224119399-884e2516-a9a1-43fd-b5f5-747c99472ace.png)
> 
> #### Additional improvements
> 
> Additionally, this changeset introduces a complementary filter "Show custom node info" (enabled by default) that extends the labels of call and exception-creation nodes with custom information; and defines and documents JavaScript helpers to simplify the new and existing available filters. Here is an example of the effect of the new "Show custom node info" filter:
> 
> ![show-custom-node-info](https://user-images.githubusercontent.com/8792647/224119545-fd564224-7ccc-4829-988e-77f05d25b3bc.png)
> 
> ### Testing
> 
> #### Functionality
> 
> - Tested the functionality manually on a small selection of graphs.
> 
> - Tested automatically that viewing thousands of graphs in the three views with different filter subsets enabled does not trigger any assertion failure (by instrumenting IGV to view graphs as they are loaded and running `java -Xcomp -XX:-TieredCompilation -XX:PrintIdealGraphLevel=4`).
> 
> #### Performance
> 
> Measured the combined filter application and view creation time for the sea-of-nodes view on a selection of 100 medium-sized graphs (200-500 nodes). On average, applying the new "Show custom node info" filter introduces a minimal overhead of around 1%, which motivates enabling it by default. Applying the "simplify graph" and "condense graph" on top actually gives a speedup of about 12%, since the additional filter application time is amortized by laying out and drawing fewer nodes. However, these filters are not enabled by default, since they cause a (minor) loss of information which is not desirable in every use case.
> 
> The graph size reduction and performance results are [attached](https://github.com/openjdk/jdk/files/10934804/performance-evaluation.ods) (note that each time measurement in the sheet corresponds to the median of ten runs).

Roberto Castañeda Lozano has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 53 commits:

 - Merge branch 'master' into JDK-8302738
 - Partially revert "Split simplify graph filter into two, ensure they are applied in right order"
   
       This reverts parts of commit 07621a8012c925eaa612ef8b35611557f9f0f4ca, as
       they have been contributed independently to mainline.
 - Fix comment typo
 - Revert "Select slots as well"
   
   This reverts commit 8256f0c20d7747cda691291c47841a9280d8c493.
   
   Revert "Fix figure selection"
   
   This reverts commit 71e73e89facfbb31614e4f1f3676c9e91a38e01a.
   
   Revert "Make slots searchable and selectable"
   
   This reverts commit 69cbec1f24ec5e941a5a72ab94b79117551d9560.
 - Increase the bold text line factor slightly
 - Add extra horizontal margin for long labels and let them overflow within the node
 - Select slots as well
 - Remove code that is commented out
 - Assert inputLabel is non-null
 - Document filter helpers
 - ... and 43 more: https://git.openjdk.org/jdk/compare/9df20600...6e6a8ecc

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

Changes: https://git.openjdk.org/jdk/pull/12955/files
 Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=12955&range=04
  Stats: 877 lines in 37 files changed: 537 ins; 207 del; 133 mod
  Patch: https://git.openjdk.org/jdk/pull/12955.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/12955/head:pull/12955

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


More information about the hotspot-compiler-dev mailing list