[13] RFR (S): 8075052: Autobox elimination hinders loop unrolling

John Rose john.r.rose at oracle.com
Sat Feb 2 05:26:15 UTC 2019


Maybe it is time to create jdk.internal.vm.annotation.NoSideEffects
and see if we can puzzle out the use cases and rules of application?
Eventually we may want something like that as an official feature.

On Feb 1, 2019, at 7:19 PM, Vladimir Ivanov <vladimir.x.ivanov at oracle.com> wrote:
> 
> http://cr.openjdk.java.net/~vlivanov/8075052/webrev.00/
> https://bugs.openjdk.java.net/browse/JDK-8075052
> 
> C2 doesn't optimize Integer.valueOf() as good as new Integer().
> (There's a benchmark in the bug which demonstrates the difference.)
> 
> It is caused by the fact that though Integer.intValue() can see through the call, the call itself isn't optimized away if the result (box) is not used. It is unconditionally inlined and hinders consequent optimizations.
> 
> Proposed fix is to treat Integer.valueOf() as if it were a pure method and remove the call if its result (boxed value) isn't used.
> 
> Testing: hs-precheckin-comp, tier1-7 (in progress)
> 
> Best regards,
> Vladimir Ivanov



More information about the hotspot-compiler-dev mailing list