[jdk17] RFR: 8269304: Regression ~5% in 2005 in b27

Vladimir Kozlov kvn at openjdk.java.net
Mon Jun 28 03:02:03 UTC 2021


On Sun, 27 Jun 2021 21:18:40 GMT, Dean Long <dlong at openjdk.org> wrote:

>> JDK-8268347 changes missed check for valid case when all locks/unlocks in coarsened group were eliminated.
>> As result methods were recompiled without locks coarsening optimization leaving locks in code.
>> 
>> Tested tier1-3, xcomp, performance.
>
> src/hotspot/share/opto/compile.cpp line 4519:
> 
>> 4517:     if (size == 0) {
>> 4518:       unbalanced = false; // All locks were eliminated - good
>> 4519:     } else if (size != locks_list->origin_cnt()) {
> 
> The size == 0 case makes sense.  Is there a possible situation where some locks were removed, but the remaining are still balanced?

Yes. For example, if one of branches in case 1 is eliminated after locks/unlocks marked as coarsened:
https://github.com/openjdk/jdk/blob/master/src/hotspot/share/opto/callnode.cpp#L1779

jbb2005 does not have such cases. And It would be really hard to separate such case  from failing case in current implementation.

I have RFE [8268571](https://bugs.openjdk.java.net/browse/JDK-8268571) it improve locks elimination I hope I can work on in JDK 18.

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

PR: https://git.openjdk.java.net/jdk17/pull/155


More information about the hotspot-compiler-dev mailing list