public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Fei Gao" <gaofei@eswincomputing.com>
To: "Kito Cheng" <kito.cheng@gmail.com>,
	 "Andrew Pinski" <pinskia@gmail.com>
Cc: gcc-patches <gcc-patches@gcc.gnu.org>,
	 "Palmer Dabbelt" <palmer@dabbelt.com>,
	 jeffreyalaw <jeffreyalaw@gmail.com>,
	 Sinan <sinan.lin@linux.alibaba.com>,
	 jiawei <jiawei@iscas.ac.cn>,
	 liaozhangjin <liaozhangjin@eswincomputing.com>
Subject: Re: Re: [PATCH 1/2] [RISC-V] disable shrink-wrap-separate if zcmp enabled.
Date: Mon, 8 May 2023 16:54:28 +0800	[thread overview]
Message-ID: <20230508165427631224154@eswincomputing.com> (raw)
In-Reply-To: <CA+yXCZCjtFxBrz2Q6OYsomuwwq-5FSh6Q5aOFRzeNLCQSoJD8g@mail.gmail.com>

On 2023-05-08 16:05  Kito Cheng <kito.cheng@gmail.com> wrote:
>
>> > diff --git a/gcc/config/riscv/riscv.cc b/gcc/config/riscv/riscv.cc
>> > index 45a63cab9c9..629e5e45cac 100644
>> > --- a/gcc/config/riscv/riscv.cc
>> > +++ b/gcc/config/riscv/riscv.cc
>> > @@ -5729,7 +5729,8 @@ riscv_get_separate_components (void)
>> >
>> >    if (riscv_use_save_libcall (&cfun->machine->frame)
>> >        || cfun->machine->interrupt_handler_p
>> > -      || !cfun->machine->frame.gp_sp_offset.is_constant ())
>> > +      || !cfun->machine->frame.gp_sp_offset.is_constant ()
>> > +      || TARGET_ZCMP)
>> >      return components;
>>
>> I think this is a bad idea. I have a use case where we use the C
>> extensions but still compile for -O2 because we want the code to be
>> fast as possible but still having the savings of the C extensions.
>
>Yeah, agree, so I would prefer to drop this from the patch series. 

Zcmp is a little different here than C. 
C extension is done fully in AS.  So  we have the code to be
fast as possible but still having the savings of the C extensions.

Zcmp and shrink-wrap-separate are both done in prologue/epilogue pass
and you can only have one switch active to direct sregs save and restore.
In my understanding, zcmp push and pop insns seem to
be mutually exclusive in functionality to shrink-wrap-separate. 
It's not expected to see zcmp insns at the begining/end of prologue/epilogue, 
and also repeated store/load sregs in separate blocks.  

Same for save and restore, and i guess that's why we have 
riscv_use_save_libcall (&cfun->machine->frame) check here.

BR, 
Fei

>
>> Thanks,
>> Andrew Pinski

  reply	other threads:[~2023-05-08  8:54 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-06  8:39 [PATCH 0/2] RISC-V: support Zcmp extension Fei Gao
2023-05-06  8:39 ` [PATCH 1/2] [RISC-V] disable shrink-wrap-separate if zcmp enabled Fei Gao
2023-05-08  2:41   ` Kito Cheng
2023-05-08  7:39     ` Fei Gao
2023-05-08  7:54   ` Andrew Pinski
2023-05-08  8:05     ` Kito Cheng
2023-05-08  8:54       ` Fei Gao [this message]
2023-05-08  9:20         ` Kito Cheng
2023-05-10  9:33           ` Fei Gao
2023-05-06  8:39 ` [PATCH 2/2] [RISC-V] support cm.push cm.pop cm.popret in zcmp Fei Gao
2023-05-08  2:48   ` Kito Cheng
2023-05-10  9:34     ` Fei Gao

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=20230508165427631224154@eswincomputing.com \
    --to=gaofei@eswincomputing.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jeffreyalaw@gmail.com \
    --cc=jiawei@iscas.ac.cn \
    --cc=kito.cheng@gmail.com \
    --cc=liaozhangjin@eswincomputing.com \
    --cc=palmer@dabbelt.com \
    --cc=pinskia@gmail.com \
    --cc=sinan.lin@linux.alibaba.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).