RFR: 8282024: add EscapeAnalysis statistics under PrintOptoStatistics [v8]
aamarsh
duke at openjdk.java.net
Fri May 20 17:11: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.
@vnkozlov Thank you for the feedback! I removed the complicated iterative feedback fix and simply left a comment in the output. My example output above is updated. I added the PrintOptoStatistics flag where it felt necessary. I also pushed my commits incrementally as opposed to squashing them and force pushing as @navyxliu suggested.
-------------
PR: https://git.openjdk.java.net/jdk/pull/8019
More information about the hotspot-compiler-dev
mailing list