RFR: 8272720: Fix the implementation of loop unrolling heuristic with LoopPercentProfileLimit

Jie Fu jiefu at openjdk.java.net
Fri Aug 20 12:47:29 UTC 2021


On Fri, 20 Aug 2021 06:31:39 GMT, Tobias Hartmann <thartmann at openjdk.org> wrote:

>> Hi all,
>> 
>> I'd like to fix the implementation of loop unrolling heuristic with `LoopPercentProfileLimit`.
>> 
>> The range of `LoopPercentProfileLimit` was designed as [10, 100] [1].
>> But in fact there is no difference when `LoopPercentProfileLimit > 50` for the current implementation.
>> 
>> This is because integer div `100 / LoopPercentProfileLimit` [2] will always return 1 when `LoopPercentProfileLimit > 50`.
>> It would be better to fix it.
>> 
>> Thanks.
>> Best regards,
>> Jie
>> 
>> [1] https://github.com/openjdk/jdk/blob/master/src/hotspot/share/opto/c2_globals.hpp#L179
>> [2] https://github.com/openjdk/jdk/blob/master/src/hotspot/share/opto/loopTransform.cpp#L908
>
> Looks good to me.

Thanks @TobiHartmann and @rickard .

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

PR: https://git.openjdk.java.net/jdk/pull/5183


More information about the hotspot-compiler-dev mailing list