RFR: 8371419: IGV: Add view to visualise dominator tree and dominator information
Daniel Lundén
dlunden at openjdk.org
Wed Nov 19 10:01:41 UTC 2025
On Thu, 13 Nov 2025 11:59:20 GMT, Damon Fenacci <dfenacci at openjdk.org> wrote:
> This change introduces a dominator tree view in IGV’s CFG panel, enabling users to toggle between the control flow graph and the dominator tree. This makes dominator relationships easier to inspect than the current stdout-based output (`-XX:+PrintDominators`).
>
> ## Motivation
> * Today, dominator information is difficult to access (e.g. via `-XX:+PrintDominators`, which is hard to read and correlate with the graph).
> * IGV already computes dominators for some phases but does not visualize them.
> * Comparing dominator trees across graphs/phases was not supported.
>
> ## What’s New
> 1. Toggle in the CFG view (toolbar button (<img width="34" height="30" alt="image" src="https://github.com/user-attachments/assets/d215d018-dbb6-4ef0-8129-2fab60999acf" />) to switch between:
> * Control Flow Graph (CFG)
> * Dominator Tree
> 2. Dominator edge coloring to indicate provenance:
> * Blue: dominator info provided by C2 (from GCM phase onward for now, a follow RFE will handle loop optimization dominator information)
> * Red: dominator info computed by IGV (pre-GCM)
> 3. Graph comparison enhancements:
> * Compare dominator trees between graphs (new)
> * Compare CFG differences between graphs (previously missing)
> 4. Node annotations:
> * `idom`: immediate dominator
> * `dom_depth`: dominator depth
> * `block`: numeric block ID for all nodes in a block
>
> The resulting main view looks like this:
> <img width="1415" height="1051" alt="Screenshot 2025-11-13 at 15 04 12" src="https://github.com/user-attachments/assets/2aedca80-45d6-40ba-8726-50d5b8fd68df" />
>
> ## Testing
> * Tier 1-3
> * Manual testing in IGV
Very nice @dafedafe, could have saved me a lot of time over many past issues! Quick comment: I think that the dominator tree view should be a separate "view" (just right of the CFG view button) instead of a "mode" as you suggest. (I'm not sure about the exact IGV terminology).
-------------
PR Comment: https://git.openjdk.org/jdk/pull/28293#issuecomment-3542267772
More information about the hotspot-compiler-dev
mailing list