public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jeff Law <jeffreyalaw@gmail.com>
To: Fei Gao <gaofei@eswincomputing.com>, gcc-patches@gcc.gnu.org
Cc: kito.cheng@gmail.com, palmer@dabbelt.com
Subject: Re: [PATCH 1/3] RISC-V: add a new parameter in riscv_first_stack_step.
Date: Sun, 16 Apr 2023 10:40:18 -0600	[thread overview]
Message-ID: <19d9683a-54a9-5a17-86d6-b88cbb68b37b@gmail.com> (raw)
In-Reply-To: <20221201100332.22226-2-gaofei@eswincomputing.com>



On 12/1/22 03:03, Fei Gao wrote:
> frame->total_size to remaining_size conversion is done as an independent patch without
> functionality change as per review comment.
> 
> gcc/ChangeLog:
> 
>          * config/riscv/riscv.cc (riscv_first_stack_step): add a new function parameter remaining_size.
>          (riscv_compute_frame_info): adapt new riscv_first_stack_step interface.
>          (riscv_expand_prologue): likewise.
>          (riscv_expand_epilogue): likewise.
> ---
>   gcc/config/riscv/riscv.cc | 48 +++++++++++++++++++--------------------
>   1 file changed, 24 insertions(+), 24 deletions(-)
> 




> @@ -5037,7 +5037,7 @@ riscv_expand_prologue (void)
>     /* Save the registers.  */
>     if ((frame->mask | frame->fmask) != 0)
>       {
> -      HOST_WIDE_INT step1 = riscv_first_stack_step (frame);
> +      HOST_WIDE_INT step1 = riscv_first_stack_step (frame, frame->total_size);
>         if (size.is_constant ())
>   	step1 = MIN (size.to_constant(), step1);
Hmm.  I generally agree that this patch has no functional changes in 
behavior.   But I wonder if there's a latent bug in the prologue code.

It seems to me that if we are optimizing for size and need to save both 
GPRs and FPRs that we don't want to be using frame->total_size as the 
libcall path to save the GPRs will have done a partial allocation, thus 
reducing the amount of stack still to allocate.  Or am I missing 
something here?



Jeff


  parent reply	other threads:[~2023-04-16 16:40 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-01 10:03 [PATCH 0/3] RISC-V: optimize stack manipulation in save-restore Fei Gao
2022-12-01 10:03 ` [PATCH 1/3] RISC-V: add a new parameter in riscv_first_stack_step Fei Gao
2023-02-03  8:52   ` [PING][PATCH " Fei Gao
2023-04-16 16:40   ` Jeff Law [this message]
2023-04-17 18:09   ` [PATCH " Jeff Law
2022-12-01 10:03 ` [PATCH 2/3] RISC-V: optimize stack manipulation in save-restore Fei Gao
2023-02-03  8:52   ` [PING] " Fei Gao
2023-04-16 16:45   ` Jeff Law
2023-04-17 22:51   ` Jeff Law
2022-12-01 10:03 ` [PATCH 3/3] RISC-V: make the stack manipulation codes more readable Fei Gao
2023-02-03  8:52   ` [PING] " Fei Gao
2023-04-18  0:14   ` Jeff Law
2023-02-03  8:52 ` [PING] [PATCH 0/3] RISC-V: optimize stack manipulation in save-restore Fei Gao
2023-02-09  2:21   ` [PING 2] " Fei Gao
2023-02-16  7:17   ` Fei Gao
2023-02-16 14:39     ` Jeff Law

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=19d9683a-54a9-5a17-86d6-b88cbb68b37b@gmail.com \
    --to=jeffreyalaw@gmail.com \
    --cc=gaofei@eswincomputing.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=kito.cheng@gmail.com \
    --cc=palmer@dabbelt.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).