RFR(S): 8154135: Loop alignment may be added inside the loop body
vladimir.kozlov at oracle.com
Fri Apr 15 17:34:51 UTC 2016
On 4/15/16 5:24 AM, Roland Westrelin wrote:
> Hi Vladimir,
> Thanks for looking at this.
>> I agree with optimization but I am not sure about changes.
> Is this an optimization? It looks more like a bug to me.
Code is correct but not optimal. I don't think it is bug.
>> Can we check only one previous block to be more conservative?:
>> Block* b = prev(targ_block)
>> bool has_top = targ_block->head()->is_Loop() && b->has_loop_alignment()
>> && !b->head()->is_Loop()
> That would be good enough as far as I can tell. Here is a new webrev:
>> Did you try to play with NumberOfLoopInstrToAlign and MaxLoopPad? May be
>> for RISC cpus (with fixed instruction size) we should change them.
> Thanks for the pointer. This said, I don't see what could prevent the
> problem I see from happening on x86 so to me it looks like a bug, rather
> than a tuning problem.
NumberOfLoopInstrToAlign code is used only on x86 and may hide the problem you see.
And I suggested to look on that code to see if we can get additional performance benefits on RISC (on arm64 in your case).
More information about the hotspot-compiler-dev