RFR(S): 8209544: AES encrypt performance regression in jdk11b11

Dmitry Chuyko dmitry.chuyko at bell-sw.com
Thu Sep 6 10:59:28 UTC 2018


On 09/06/2018 10:16 AM, Roland Westrelin wrote:
> Hi Dmitry,
>
>> -prof perfnorm shows 7-14% more branch misses.
> My patch doesn't make any change to the stubs. It only tweaks c2
> compiled code.
One guess could be that other code influenced branches prediction in the 
stub.
>   Do you see any difference in the code generated for
> com.sun.crypto.provider.CipherCore::doFinal?
Yes. Here is how it looks like:

Current

             0x0000fffca85ffd68: add    w16, w4, w10                ;*invokestatic addExact {reexecute=0 rethrow=0 return_oop=0}
                                                                       ; - com.sun.crypto.provider.CipherCore::getOutputSizeByOperation at 17 (line 328)
                                                                       ; - com.sun.crypto.provider.CipherCore::doFinal at 20 (line 917)
   0.02%     0x0000fffca85ffd6c: cmp    w14, #0x1
             0x0000fffca85ffd70: b.cc    0x0000fffca85fff20  // b.lo, b.ul, b.last
                                                                       ;*lookupswitch {reexecute=0 rethrow=0 return_oop=0}
                                                                       ; - com.sun.crypto.provider.CipherCore::getOutputSizeByOperation at 25 (line 329)
                                                                       ; - com.sun.crypto.provider.CipherCore::doFinal at 20 (line 917)
             0x0000fffca85ffd74: lsl    x11, x11, #3                ;*getfield padding {reexecute=0 rethrow=0 return_oop=0}
                                                                       ; - com.sun.crypto.provider.CipherCore::getOutputSizeByOperation at 92 (line 344)
                                                                       ; - com.sun.crypto.provider.CipherCore::doFinal at 20 (line 917)

Patched/-XX:-UseSwitchProfiling

            0x0000fffcd86000e4: add    w16, w4, w15                ;*invokestatic addExact {reexecute=0 rethrow=0 return_oop=0}
                                                                      ; - com.sun.crypto.provider.CipherCore::getOutputSizeByOperation at 17 (line 328)
                                                                      ; - com.sun.crypto.provider.CipherCore::doFinal at 20 (line 917)
   0.01%    0x0000fffcd86000e8: cmp    w14, #0x7
            0x0000fffcd86000ec: b.eq    0x0000fffcd8600234  // b.none  ;*lookupswitch {reexecute=0 rethrow=0 return_oop=0}
                                                                      ; - com.sun.crypto.provider.CipherCore::getOutputSizeByOperation at 25 (line 329)
                                                                      ; - com.sun.crypto.provider.CipherCore::doFinal at 20 (line 917)
            0x0000fffcd86000f0: lsl    x11, x12, #3                ;*getfield padding {reexecute=0 rethrow=0 return_oop=0}
                                                                      ; - com.sun.crypto.provider.CipherCore::getOutputSizeByOperation at 92 (line 344)
                                                                      ; - com.sun.crypto.provider.CipherCore::doFinal at 20 (line 917)

There are also several instructions/blocks rearrangements.

-Dmitry

>
> Roland.



More information about the hotspot-compiler-dev mailing list