RFR: 8356761: IGV: dump escape analysis information
Anton Seoane Ampudia
aseoane at openjdk.org
Wed Nov 12 12:27:13 UTC 2025
On Wed, 12 Nov 2025 11:01:30 GMT, Roberto Castañeda Lozano <rcastanedalo at openjdk.org> wrote:
>> This PR introduces new IGV dumps, property fields and filters related to escape analysis information.
>>
>> The C2 escape analysis algorithm is carried out in six primary steps, of which many have interesting sub-steps (e.g. `split_unique_types`) or present an iterative nature where access to intermediate results can aid debugging and analysis. Additionally, escape analysis relies on an "intermediate structure" called the _connection graph_, which is also particularly valuable for deeper investigations.
>>
>> With this changeset, escape analysis information is now dumped at key points throughout the algorithm, with a degree of granularity (from only the basic steps to in-detail iterative dumping). The dumps include several property fields, such as:
>>
>> - Node escape “level”.
>> - Scalar replaceability.
>> - Node type within the connection graph (per [C2 Escape Analysis connection graph](https://wiki.openjdk.org/display/HotSpot/EscapeAnalysis)).
>>
>> This is achieved by passing the `ConnectionGraph` in use to the `IdealGraphPrinter` during escape analysis, so that these properties can be dumped. After escape analysis, remaining interesting information that is left until macro elimination (and consequent elimination of non-escaping, replaceable allocations) is also dumped.
>>
>> Additionally, two filters are provided: one for displaying the connection node type in the IGV node box, and another one for color-scaling nodes based on their escaping/scalar status.
>>
>> **Testing:** passes tiers 1-3, manual testing in IGV
>
> src/hotspot/share/opto/escape.cpp line 3153:
>
>> 3151: revisit_reducible_phi_status(jobj, reducible_merges);
>> 3152: found_nsr_alloc = true;
>> 3153: _compile->print_method(PHASE_EA_PROPAGATE_NSR_ITER, 5);
>
> Why dumping here and not for the `use->is_LocalVar()` case? Anyway, maybe it would be more useful to dump one or two levels up instead, e.g. for each `jobj`.
Absolutely. I guess at some point of trying different places I forgot to move it back where it should be
> src/hotspot/share/opto/escape.cpp line 4749:
>
>> 4747: uint new_index_end = (uint) _compile->num_alias_types();
>> 4748:
>> 4749: _compile->print_method(PHASE_EA_AFTER_SPLIT_UNIQUE_TYPES_1, 5);
>
> I guess there is no `PHASE_EA_AFTER_SPLIT_UNIQUE_TYPES_2` because Phase 2 does not change the state of the Ideal graph or the connection graph and hence the changes are not observable within IGV, right?
Correct
> src/hotspot/share/opto/escape.cpp line 5173:
>
>> 5171: }
>> 5172: }
>> 5173:
>
> Spurious change?
Yes, I had a function there and when removing it I got rid of the line apparently.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/28060#discussion_r2518098779
PR Review Comment: https://git.openjdk.org/jdk/pull/28060#discussion_r2518099327
PR Review Comment: https://git.openjdk.org/jdk/pull/28060#discussion_r2518106520
More information about the hotspot-compiler-dev
mailing list