RFR: 8227505: SuperWordLoopUnrollAnalysis may lead to over loop unrolling

Jie Fu fujie at loongson.cn
Wed Aug 7 01:59:44 UTC 2019


Hi Vladimir,

Thanks for your review and valuable comments.
Please see comments below.

On 2019/8/7 上午5:58, Vladimir Kozlov wrote:
> Hi Jie
>
>  Even if your optimization helps in particular case it may make some 
> loop regress due to executing more branches.

Yes, I agree.


>
> On 7/11/19 1:20 AM, Jie Fu wrote:
>> Hi all,
>>
>> With more experiments, the loop's trip_count seems a good feature to 
>> detect over loop unrolling.
>> And on some platforms, the branch-miss rate had been observed 
>> increasing dramatically with small loop trip count.
>
> Why? With more unrolling you should have less number of branches.

I had just asked my kernel colleagues to explain the strange perf results.
They found that I had used an old version of perf which had some bugs in it.
So I'm sorry for that noise.


>
>> It seems that we shouldn't unroll if the trip count becomes too small.
>
> May be there is different explanation for this. May be big loop body 
> does not fit into code buffer in X86 cpu - or something like that. End 
> we should watch for body size instead.
OK. I will try to find a better solution.

Thanks a lot.
Best regards,
Jie



More information about the hotspot-compiler-dev mailing list