Re: Re: [PATCH 1/2] [RISC-V] disable shrink-wrap-separate if zcmp enabled.

2023-05-10 Thread Fei Gao
On 2023-05-08 17:20  Kito Cheng wrote: > >-msave-restore is a different story; it's only enabled when the user >requests, but `-march` describes the capability of the target >architecture, not specify the preference of performance or size, which >should be determined by -O1~-O3/-Ofast or -Os/-Oz.

Re: Re: [PATCH 1/2] [RISC-V] disable shrink-wrap-separate if zcmp enabled.

2023-05-08 Thread Kito Cheng via Gcc-patches
-msave-restore is a different story; it's only enabled when the user requests, but `-march` describes the capability of the target architecture, not specify the preference of performance or size, which should be determined by -O1~-O3/-Ofast or -Os/-Oz. On Mon, May 8, 2023 at 4:54 PM Fei Gao wrote

Re: Re: [PATCH 1/2] [RISC-V] disable shrink-wrap-separate if zcmp enabled.

2023-05-08 Thread Fei Gao
On 2023-05-08 16:05  Kito Cheng 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) >> >

Re: [PATCH 1/2] [RISC-V] disable shrink-wrap-separate if zcmp enabled.

2023-05-08 Thread Kito Cheng via Gcc-patches
> > 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->machi

Re: [PATCH 1/2] [RISC-V] disable shrink-wrap-separate if zcmp enabled.

2023-05-08 Thread Andrew Pinski via Gcc-patches
On Sat, May 6, 2023 at 1:41 AM Fei Gao wrote: > > zcmp aims to reduce code size, while shrink-wrap-separate prefers > speed to code size. So disable shrink-wrap-separate if zcmp > enabled, just like what save-restore has done. > > author: Zhangjin Liao liaozhang...@eswincomputing.com > > gcc/Chang

Re: Re: [PATCH 1/2] [RISC-V] disable shrink-wrap-separate if zcmp enabled.

2023-05-08 Thread Fei Gao
On 2023-05-08 10:41  Kito Cheng wrote: > >shrink-wraping already gated by Os so I think we don't need add more >gate here, unless we are trying to claim force optimize for size if >zcmp is present. > hi Kito Zcmp is added here just like save-restore. Either we add them both, or delete. BR,  F

Re: [PATCH 1/2] [RISC-V] disable shrink-wrap-separate if zcmp enabled.

2023-05-07 Thread Kito Cheng via Gcc-patches
shrink-wraping already gated by Os so I think we don't need add more gate here, unless we are trying to claim force optimize for size if zcmp is present. On Sat, May 6, 2023 at 4:41 PM Fei Gao wrote: > > zcmp aims to reduce code size, while shrink-wrap-separate prefers > speed to code size. So di

[PATCH 1/2] [RISC-V] disable shrink-wrap-separate if zcmp enabled.

2023-05-06 Thread Fei Gao
zcmp aims to reduce code size, while shrink-wrap-separate prefers speed to code size. So disable shrink-wrap-separate if zcmp enabled, just like what save-restore has done. author: Zhangjin Liao liaozhang...@eswincomputing.com gcc/ChangeLog: * config/riscv/riscv.cc (riscv_get_separate_co