[PATCH] rs6000: Don't emit a use of LR in returns and sibcalls

David Edelsohn dje.gcc@gmail.com
Tue Aug 30 13:00:00 GMT 2016


On Tue, Aug 30, 2016 at 7:17 AM, Segher Boessenkool
<segher@kernel.crashing.org> wrote:
> The exit block (to which every return artificially jumps) already has
> a use of LR.  The LR use in all returns and sibcalls is an anachronism,
> probably made unnecessary by the dataflow merge.  The simple_returns
> that shrink-wrapping generates also do not have such a use.  Newer
> backends do not do this either it seems.
>
> With this use removed, a normal return is no longer a parallel but just
> a return insn, and cfgcleanup then can transform conditional jumps to
> those into conditional returns.
>
> This splits the return emission code with restoring_FPRs_inline from
> that without it; this is simpler code, fewer lines, and less indentation.
>
> The return_internal_<mode> pattern can now be deleted since nothing uses
> it anymore.
>
> Tested on powerpc64-linux (-m32,-m64); will test on powerpc64le-linux
> as well.  David and Iain, can you please test on AIX and Darwin?
>
> Or is this okay for trunk without testing?  ;-)
>
>
> Segher
>
>
> 2016-08-30  Segher Boessenkool  <segher@kernel.crashing.org>
>
>         * config/rs6000/rs6000.c (rs6000_emit_epilogue): Do not emit
>         USEs of LR_REGNO in returns and sibcalls.
>         (rs6000_output_mi_thunk): Similar.
>         (rs6000_sibcall_aix): Similar.
>         * config/rs6000/rs6000.md (sibcall, sibcall_value, sibcall_local32,
>         sibcall_local64, sibcall_value_local32, sibcall_value_local64,
>         sibcall_nonlocal_sysv<mode>, sibcall_value_nonlocal_sysv<mode>):
>         Remove the USE of LR_REGNO from the patterns as well.  Delete an
>         obsolete comment.
>         (return_internal_<mode>): Delete.

This is okay.

PPC64 BE Linux uses ABI_AIX, so that AIX logic should be okay.

Thanks, David



More information about the Gcc-patches mailing list