RFR: 8295166: IGV: dump graph at more locations
Roberto Castañeda Lozano
rcastanedalo at openjdk.org
Tue Dec 5 12:12:57 UTC 2023
On Tue, 10 Oct 2023 13:31:00 GMT, Daniel Lundén <duke at openjdk.org> wrote:
> This changeset
> 1. adds a number of new graph dumps for IdealGraphVisualizer (IGV):
> - Before conditional constant propagation
> - After register allocation
> - After block ordering
> - After peephole optimization
> - After post-allocation expansion
> - Before and after
> - loop predication
> - loop peeling
> - pre/main/post loops
> - loop unrolling
> - range check elimination
> - loop unswitching
> - partial peeling
> - split if
> - superword
> 2. adds support for enumeration of repeated IGV graph dumps.
> 3. adjusts IGV print levels to encompass the new graph dumps. The old levels 4 and 5 are now levels 5 and 6. The new level 4 is for loop optimization dumps.
>
> Example phase list screenshots in IGV (first at level 6, second at level 4)
>  
>
>
> Some notes:
> - While discussing the above changes, a separate question was brought up by @chhagedorn:
> > On a separate note, I'm wondering how useful it is to always dump all JFR events when calling print_method(). Should this be revisited again in general?
> - The new IGV graph dump enumeration enables a number of cleanups. There is now another RFE for IGV cleanup: [JDK-8319599](https://bugs.openjdk.org/browse/JDK-8319599).
>
> ### Testing
> #### Platforms: windows-x64, linux-x64, linux-aarch64, macosx-x64, macosx-aarch64
> - tier1, tier2, tier3, tier4, tier5.
> - Check that optimized builds (`--with-debug-level optimized`) still work.
>
> #### Platforms: linux-x64
> - Tested that thousands of graphs are correctly opened and visualized with IGV.
Hi Daniel, thanks for working on this! The code changes themselves look good, I have a few comments/suggestions:
- It might make sense to create a new print level between current 3 and 4 including the new loop transformation dumps but not the individual IGVN step dumps.
- I see the value in numbering the `PHASE_PHASEIDEALLOOP_ITERATIONS` dumps, but I am not sure numbering the new loop transformations is worth the additional complexity (`_igv_phase_iter` array, etc.). Limiting numbering to `PHASE_PHASEIDEALLOOP_ITERATIONS` dumps would not require any additional state in `Compile`.
- In my opinion, it would be clearer to only dump loop transformations if they actually take place. I find it a bit confusing to see e.g. `Before/After superword ...` graph dumps when vectorization has actually failed and the graph has not changed at all. Dumping only after effective transformations would also match better the output of `TraceLoopOpts`. Enforcing this invariant would require getting rid of the `Before...` dumps though, but this is acceptable (and perhaps even preferable) in my opinion.
-------------
PR Review: https://git.openjdk.org/jdk/pull/16120#pullrequestreview-1684732753
More information about the hotspot-compiler-dev
mailing list