RFR: 8310220: IGV: dump graph after each IGVN step at level 4
Roberto Castañeda Lozano
rcastanedalo at openjdk.org
Mon Jun 19 11:47:22 UTC 2023
This changeset instruments Iterative GVN (IGVN) in C2 to dump the Ideal graph after each effective step (i.e. when the graph is rewritten or the recorded types are refined). This enables fine-grain tracing of IGVN transformation sequences using Ideal Graph Visualizer. This technique has proved useful for the investigation of [JDK-8310220](https://bugs.openjdk.org/browse/JDK-8310220), and can be also useful for educational purposes:
![igv-level4](https://github.com/openjdk/jdk/assets/8792647/56dc9729-d5eb-44f3-8614-dc72e17f1bef)
These new dumps are emitted at print level 4 (`PrintIdealGraphLevel=4`), the highest level of detail.
Following [feedback](https://bugs.openjdk.org/browse/JDK-8310220?focusedCommentId=14590132&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-14590132) and offline discussions with Christian Hagedorn, the changeset also dumps the Ideal graph before and after IGVN at print level 3. This makes it possible to identify the source of graph changes between IGVN and other phases such as loop transformations. Finally, the existing phase `PHASE_MACH_ANALYSIS` is also promoted to print level 3, since it prints a single graph per compilation unit only (see print level documentation updates in this changeset):
![igv-level3](https://github.com/openjdk/jdk/assets/8792647/9bccc78b-13b8-428d-8c98-ef3f0f769f4c)
The changeset increases the number of graph dumps per compilation at print levels 3 and 4 by 30-40%. This additional overhead is in my opinion justified by the value provided by the additional dumps, and the high print level at which they are produced.
#### Testing
- tier1-3 (linux-x64; release and debug mode).
- Verified that thousands of new IGVN graph dumps are correctly opened and visualized with the Ideal Graph Visualizer, at print levels 3 and 4.
-------------
Commit messages:
- Dump graph before IGVN (by popular demand) and after IGVN (for symmetry)
- Update IGV's README
- Promote PHASE_MACH_ANALYSIS dump to print level 3 (since it runs once per compilation)
- Dump Ideal graph after each IGVN step (in print level 4)
Changes: https://git.openjdk.org/jdk/pull/14537/files
Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=14537&range=00
Issue: https://bugs.openjdk.org/browse/JDK-8310220
Stats: 23 lines in 4 files changed: 12 ins; 1 del; 10 mod
Patch: https://git.openjdk.org/jdk/pull/14537.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/14537/head:pull/14537
PR: https://git.openjdk.org/jdk/pull/14537
More information about the hotspot-compiler-dev
mailing list