RFR(S): 8154135: Loop alignment may be added inside the loop body

Vladimir Kozlov vladimir.kozlov at oracle.com
Thu Apr 14 23:12:56 UTC 2016


I agree with optimization but I am not sure about changes.

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()

Did you try to play with NumberOfLoopInstrToAlign and MaxLoopPad? May be for RISC cpus (with fixed instruction size) we should change them.

Thanks,
Vladimir

On 4/13/16 11:46 PM, Roland Westrelin wrote:
>
> When running scimark on aarch64:
>
>   ;; B16: #	B17 <- B21  top-of-loop Freq: 2305.21
>
>    0x000003ffa126f710: add	w17, w11, w12   ;*iadd {reexecute=0 rethrow=0 return_oop=0}
>                                                  ; - jnt.scimark2.FFT::transform_internal at 243 (line 129)
>
>    0x000003ffa126f714: nop
>    0x000003ffa126f718: nop
>    0x000003ffa126f71c: nop                       ;*iconst_2 {reexecute=0 rethrow=0 return_oop=0}
>                                                  ; - jnt.scimark2.FFT::transform_internal at 238 (line 129)
>
>   ;; B17: #	B32 B18 <- B25 B16 	Loop: B17-B16 inner  Freq: 3056.06
>
>    0x000003ffa126f720: lsl	w16, w17, #1    ;*imul {reexecute=0 rethrow=0 return_oop=0}
>                                                  ; - jnt.scimark2.FFT::transform_internal at 244 (line 129)
>
> The 3 nops are added by the code that aligns loop entries: the top of
> loop block is first encountered and its alignment is set, the loop head
> is later encountered through the backbranch of an outer loop and its
> alignment is set.
>
> I propose that the code that aligns loop entries verifies that a loop
> top doesn't exist before it sets the alignment:
>
> http://cr.openjdk.java.net/~roland/8154135/webrev.00/
>
> Roland.
>


More information about the hotspot-compiler-dev mailing list