public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jeff Law <jeffreyalaw@gmail.com>
To: gcc-patches@gcc.gnu.org, richard.sandiford@arm.com
Subject: Re: [PATCH] Add a target hook for sibcall epilogues
Date: Tue, 15 Nov 2022 20:37:21 -0700	[thread overview]
Message-ID: <8ba05f30-5c6f-33a0-5144-2cf197886c28@gmail.com> (raw)
In-Reply-To: <mpth6z5sbpy.fsf@arm.com>


On 11/11/22 09:22, Richard Sandiford via Gcc-patches wrote:
> Epilogues for sibling calls are generated using the
> sibcall_epilogue pattern.  One disadvantage of this approach
> is that the target doesn't know which call the epilogue is for,
> even though the code that generates the pattern has the call
> to hand.
>
> Although call instructions are currently rtxes, and so could be
> passed as an operand to the pattern, the main point of introducing
> rtx_insn was to move towards separating the rtx and insn types
> (a good thing IMO).  There also isn't an existing practice of
> passing genuine instructions (as opposed to labels) to
> instruction patterns.
>
> This patch therefore adds a hook that can be defined as an
> alternative to sibcall_epilogue.  The advantage is that it
> can be passed the call; the disadvantage is that it can't
> use .md conveniences like generating instructions from
> textual patterns (although most epilogues are too complex
> to benefit much from that anyway).
>
> Tested on aarch64-linux-gnu and x86_64-linux-gnu.  OK to install?
>
> Richard
>
>
> gcc/
> 	* doc/gccint/target-macros/miscellaneous-parameters.rst:
> 	Add TARGET_EMIT_EPILOGUE_FOR_SIBCALL.
> 	* doc/gccint/target-macros/tm.rst.in: Regenerate.
> 	* target.def (emit_epilogue_for_sibcall): New hook.
> 	* calls.cc (can_implement_as_sibling_call_p): Use it.
> 	* function.cc (thread_prologue_and_epilogue_insns): Likewise.
> 	(reposition_prologue_and_epilogue_notes): Likewise.
> 	* config/aarch64/aarch64-protos.h (aarch64_expand_epilogue): Take
> 	an rtx_call_insn * rather than a bool.
> 	* config/aarch64/aarch64.cc (aarch64_expand_epilogue): Likewise.
> 	(TARGET_EMIT_EPILOGUE_FOR_SIBCALL): Define.
> 	* config/aarch64/aarch64.md (epilogue): Update call.
> 	(sibcall_epilogue): Delete.

Presumably you're going to do something useful with the new hook :-)


OK.

jeff



  reply	other threads:[~2022-11-16  3:37 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-11 16:22 Richard Sandiford
2022-11-16  3:37 ` Jeff Law [this message]
2023-12-05  9:37 Richard Sandiford

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8ba05f30-5c6f-33a0-5144-2cf197886c28@gmail.com \
    --to=jeffreyalaw@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=richard.sandiford@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).