[10] RFR(M): 8176506: C2: loop unswitching and unsafe accesses cause crash

Andrew Haley aph at redhat.com
Thu Apr 20 11:21:24 UTC 2017


On 20/04/17 12:12, Roland Westrelin wrote:
>> It could affect loop optimizations and cause performance regression 
>> loops have unsafe access. On other hand unsafe accesses have membars so 
>> it may be not big deal.
>> At least run Andrew's ByteBuffers ;)
>
> This change hurts Andrew's ByteBuffers test. But I intend to next
> propose a change that uses profiling at unsafe call sites to speculate
> that an unsafe access is on heap (at the cost of a null check). With
> this change C2 will generate code as good as it currently does for
> Andrew's test.

Well, yes, I know.  :-)

But the real goal of that ByteBuffer test (and indeed all of the
ByteBuffer optimizations) is to provide access to raw memory "as fast
as C", and has implications for project Valhalla, etc.

So it's really important that it not regress.

Andrew.


More information about the hotspot-compiler-dev mailing list