RFR: 8310220: IGV: dump graph after each IGVN step at level 4 [v2]
Christian Hagedorn
chagedorn at openjdk.org
Wed Aug 30 08:55:44 UTC 2023
On Wed, 30 Aug 2023 08:50:12 GMT, Roberto Castañeda Lozano <rcastanedalo at openjdk.org> wrote:
>> 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-grained tracing of IGVN transformation sequences using Ideal Graph Visualizer. This technique has proved useful for the investigation of [JDK-8303513](https://bugs.openjdk.org/browse/JDK-8303513), and can be also useful for educational purposes:
>>
>> 
>>
>> 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. 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). These additional changes increase the number of graph dumps per compilation at print level 3 by around 1.5x:
>>
>> 
>>
>> Finally, the verbose and rarely used bytecode parsing dumps are relegated to a new print level 5, which leaves the number of graphs per compilation at level 4 roughly as before the changeset.
>>
>> #### 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 to 5.
>
> Roberto Castañeda Lozano has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains eight additional commits since the last revision:
>
> - Update compile phase list in IR test framework
> - Fix typo
> - Move bytecode parse dumping to a new IGV dump level 5
> - Merge branch 'master' into JDK-8310220
> - 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)
src/hotspot/share/opto/phaseX.cpp line 896:
> 894: const Type* newtype = type_or_null(n);
> 895: if (nn != n || oldtype != newtype) {
> 896: C->print_method(PHASE_AFTER_ITER_GVN_STEP, 4, n);
Should we keep this at level 4 and move the parser generated dumps to a new level 5? I often add dumps for these steps during IGVN but I rarely ever need the parser generated dumps.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/14537#discussion_r1236763830
More information about the hotspot-compiler-dev
mailing list