On 04/02/14 12:27, Richard Sandiford wrote:
> This patch adds return and simple_return patterns to the s390 backend,
> which eanbles shrink-wrapping and conditional returns to be used.
> 
> Perhaps the only subtle thing is the handling of call-clobbered base
> registers.  The idea is to emit the initialising main_pool pattern in
> both early_mach -- at the very beginning of the function -- and in the
> prologue.  Then, if shrink-wrapping is used, the one added by early_mach
> will still be the first in the function.  If shrink-wrapping isn't used
> then the one added by the prologue will be the first in the function.
> s390_mainpool_start then deletes whichever isn't needed.
> 
> Tested in the same way as the previous patches.  OK to install?
> 
> Thanks,
> Richard
> 
> 
> gcc/
>       * config/s390/s390-protos.h (s390_can_use_simple_return_insn)
>       (s390_can_use_return_insn): Declare.
>       * config/s390/s390.h (EPILOGUE_USES): Define.
>       * config/s390/s390.c (s390_mainpool_start): Allow two main_pool
>       instructions.
>       (s390_chunkify_start): Handle return JUMP_LABELs.
>       (s390_early_mach): Emit a main_pool instruction on the entry edge.
>       (s300_set_up_by_prologue, s390_can_use_simple_return_insn)
>       (s390_can_use_return_insn): New functions.
>       (s390_fix_long_loop_prediction): Handle conditional returns.
>       (TARGET_SET_UP_BY_PROLOGUE): Define.
>       * config/s390/s390.md (ANY_RETURN): New code iterator.
>       (*creturn, *csimple_return, return, simple_return): New patterns.

Ok to apply.  Thanks!

-Andreas-

Reply via email to