RFR: 8282024: add EscapeAnalysis statistics under PrintOptoStatistics [v8]

Xin Liu xliu at openjdk.java.net
Tue May 10 18:26:55 UTC 2022


On Mon, 9 May 2022 23:48:58 GMT, Vladimir Kozlov <kvn at openjdk.org> wrote:

>> aamarsh has refreshed the contents of this pull request, and previous commits have been removed. The incremental views will show differences compared to the previous content of the PR. The pull request contains one new commit since the last revision:
>> 
>>   adding escape analysis and scalar replacement statistics
>
> src/hotspot/share/opto/compile.cpp line 2217:
> 
>> 2215:     Atomic::add(&ConnectionGraph::_arg_escape_counter, _local_arg_escape_ctr);
>> 2216:     Atomic::add(&ConnectionGraph::_global_escape_counter, _local_global_escape_ctr);
>> 2217: #endif
> 
> These should be done inside  `ConnectionGraph` - don't expose EA counters to an other class. You can use a static method in `ConnectionGraph` to do that.
> 
> `_no_escape_counter, _local_no_escape_ctr + total_scalar_replaced` is wrong. You are doubling number because `total_scalar_replaced` is part of `_local_no_escape_ctr`. Keep these numbers separate. Also `mexp._local_scalar_replaced` could be update later during `PhaseMacroExpand::expand_macro_nodes()` call after loop optimizations.
> 
> And such collection is not accurate (over-counted) due to EA iterations - each iteration may add the same numbers. Which could be fine if you say that in comments so people know.

hi, @vnkozlov 
My understanding is 'total_scalar_replaced' is all scalarized objects in all prior EA iterations.It's kinda of adjustment.

Iterative EA diminishes some java objects. The reported data are last snapshot with adjustment. They account for all java objects.

-------------

PR: https://git.openjdk.java.net/jdk/pull/8019


More information about the hotspot-compiler-dev mailing list