[15] RFR (M): 8237581: Improve allocation expansion
Nils Eliasson
nils.eliasson at oracle.com
Tue Jan 28 11:15:50 UTC 2020
Hi,
I added a simple micro that triggers the optimization.
Micro:
http://cr.openjdk.java.net/~neliasso/8237581/webrev.micro/
On my workstation I get these numbers:
JDK/JDK:
Benchmark (size) Mode Cnt Score
Error Units
ArrayAllocation.eliminateArrayConstLength 128 avgt
61.178 ns/op
ArrayAllocation.eliminateArrayVarLength 128 avgt
55.109 ns/op
JDK/JDK + path for 8237581:
Benchmark (size) Mode Cnt Score
Error Units
ArrayAllocation.eliminateArrayConstLength 128 avgt
0.841 ns/op
ArrayAllocation.eliminateArrayVarLength 128 avgt
1.897 ns/op
Speedup 30-70x
Please review,
Regards,
Nils
On 2020-01-27 11:01, Nils Eliasson wrote:
> Hi,
>
> I split the patch into two parts for easier review:
>
> Refactoring:
>
> http://cr.openjdk.java.net/~neliasso/8237581/webrev.refactor/
>
> The actual change (on top of the refactoring)
>
> http://cr.openjdk.java.net/~neliasso/8237581/webrev.change/
>
>
> Best regards,
> Nils Eliasson
>
> On 2020-01-24 09:36, Nils Eliasson wrote:
>> Hi,
>>
>> This patch improves expand_allocate_common when there is no use of
>> the allocation.
>>
>> Three cases are improved:
>>
>> - With unknown allocation length - don't expand the fast path. No
>> allocation is needed when it isn't used. NegativeArraySizeException
>> will still be caught by the slowpath.
>> - With known length inside the legal range - No fast path or slow
>> path is needed. The allocation node is removed.
>> - With known length outside the legal range - only a slow path is
>> needed.
>>
>> I also refactored the code a bit, keeping the general structure for
>> easy diff, but extracting some routines too make it more readable.
>>
>> Bug: https://bugs.openjdk.java.net/browse/JDK-8237581
>> Webrev: http://cr.openjdk.java.net/~neliasso/8237581/webrev.03/
>>
>> Please review!
>>
>> Best regards,
>> Nils Eliasson
>>
>>
>
More information about the hotspot-compiler-dev
mailing list