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

Xin Liu xliu at openjdk.java.net
Tue May 3 19:02:17 UTC 2022


On Mon, 2 May 2022 20:28:22 GMT, aamarsh <duke at openjdk.java.net> wrote:

>> Escape Analysis and Scalar Replacement statistics were added when the -XX:+PrintOptoStatistics flag is set. All code is placed in `#ifndef Product` block, so this code is only run when creating a debug build. Using renaissance benchmark I ran a few tests to confirm that numbers were printing correctly. Below is an example run:
>> 
>> 
>> No escape = 372, Arg escape = 74, Global escape = 1855 (EA executed in   10.49 seconds)
>> Objects scalar replaced = 240, Monitor objects removed = 44, GC barriers removed = 37, Memory barriers removed = 284
>
> 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

hi, 

Thank you for working on this. In generally, I think it looks good.  only small suggests left.

src/hotspot/share/opto/compile.cpp line 2215:

> 2213: #ifndef PRODUCT
> 2214:     Atomic::add(&ConnectionGraph::_no_escape_counter, total_scalar_replaced);
> 2215:     Atomic::add(&ConnectionGraph::_no_escape_counter, _local_no_escape_ctr);

you can merge two atomic operations into one.  Atomic::add(&ConnectionGraph::_no_escape_counter(&ConnectionGraph::_no_escape_counter, _local_no_escape_ctr + total_scalar_replaced); 

This is smart. last revision is the final revision.

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

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


More information about the hotspot-compiler-dev mailing list