Re: [PATCH] Enable shrink wrapping for the RISC-V target.

2022-11-17 Thread Philipp Tomsich
v3 committed to master. Thanks! Philipp. On Thu, 17 Nov 2022 at 11:55, Manolis Tsamis wrote: > On Thu, Nov 17, 2022 at 4:09 AM Jeff Law wrote: > > > > > > On 11/16/22 03:26, Manolis Tsamis wrote: > > > On Sun, Nov 13, 2022 at 3:33 AM Jeff Law via Gcc-patches > > > wrote: > > >> > > >> On 11/7/

Re: [PATCH] Enable shrink wrapping for the RISC-V target.

2022-11-17 Thread Manolis Tsamis
On Thu, Nov 17, 2022 at 4:09 AM Jeff Law wrote: > > > On 11/16/22 03:26, Manolis Tsamis wrote: > > On Sun, Nov 13, 2022 at 3:33 AM Jeff Law via Gcc-patches > > wrote: > >> > >> On 11/7/22 15:07, Palmer Dabbelt wrote: > >>> On Thu, 03 Nov 2022 15:23:28 PDT (-0700), j...@ventanamicro.com wrote: > >

Re: [PATCH] Enable shrink wrapping for the RISC-V target.

2022-11-16 Thread Jeff Law via Gcc-patches
On 11/16/22 03:26, Manolis Tsamis wrote: On Sun, Nov 13, 2022 at 3:33 AM Jeff Law via Gcc-patches wrote: On 11/7/22 15:07, Palmer Dabbelt wrote: On Thu, 03 Nov 2022 15:23:28 PDT (-0700), j...@ventanamicro.com wrote: On 11/2/22 18:26, Palmer Dabbelt wrote: I also tried to remove that restr

Re: [PATCH] Enable shrink wrapping for the RISC-V target.

2022-11-16 Thread Manolis Tsamis
On Sun, Nov 13, 2022 at 3:33 AM Jeff Law via Gcc-patches wrote: > > > On 11/7/22 15:07, Palmer Dabbelt wrote: > > On Thu, 03 Nov 2022 15:23:28 PDT (-0700), j...@ventanamicro.com wrote: > >> > >> On 11/2/22 18:26, Palmer Dabbelt wrote: > >>> > > I also tried to remove that restriction but it lo

Re: [PATCH] Enable shrink wrapping for the RISC-V target.

2022-11-12 Thread Jeff Law via Gcc-patches
On 11/7/22 15:07, Palmer Dabbelt wrote: On Thu, 03 Nov 2022 15:23:28 PDT (-0700), j...@ventanamicro.com wrote: On 11/2/22 18:26, Palmer Dabbelt wrote: I also tried to remove that restriction but it looks like it can't work because we can't create pseudo-registers during shrink wrapping and

Re: [PATCH] Enable shrink wrapping for the RISC-V target.

2022-11-07 Thread Palmer Dabbelt
On Thu, 03 Nov 2022 15:23:28 PDT (-0700), j...@ventanamicro.com wrote: On 11/2/22 18:26, Palmer Dabbelt wrote: I also tried to remove that restriction but it looks like it can't work because we can't create pseudo-registers during shrink wrapping and shrink wrapping can't work either. I beli

Re: [PATCH] Enable shrink wrapping for the RISC-V target.

2022-11-03 Thread Jeff Law
On 11/2/22 18:26, Palmer Dabbelt wrote: I also tried to remove that restriction but it looks like it can't work because we can't create pseudo-registers during shrink wrapping and shrink wrapping can't work either. I believe this means that shrink wrapping cannot interfere with a long stac

Re: [PATCH] Enable shrink wrapping for the RISC-V target.

2022-11-02 Thread Palmer Dabbelt
On Wed, 02 Nov 2022 08:06:36 PDT (-0700), j...@ventanamicro.com wrote: On 11/2/22 07:54, Manolis Tsamis wrote: I've revisited this testcase and I think it's not possible to make it work with the current implementation. It's not possible to trigger shrink wrapping in this case since the wrappin

Re: [PATCH] Enable shrink wrapping for the RISC-V target.

2022-11-02 Thread Jeff Law
On 11/2/22 07:54, Manolis Tsamis wrote: I've revisited this testcase and I think it's not possible to make it work with the current implementation. It's not possible to trigger shrink wrapping in this case since the wrapping of registers is guarded by if (SMALL_OPERAND (offset)) { bitmap_set

Re: [PATCH] Enable shrink wrapping for the RISC-V target.

2022-11-02 Thread Jeff Law
On 11/2/22 08:12, Manolis Tsamis wrote: On Wed, Oct 19, 2022 at 8:16 PM Jeff Law via Gcc-patches wrote: On 10/18/22 11:35, Palmer Dabbelt wrote: I would have expected things to work fine with libcalls, perhaps with the exception of the save/restore libcalls. So that needs deeper investigat

Re: [PATCH] Enable shrink wrapping for the RISC-V target.

2022-11-02 Thread Manolis Tsamis
On Wed, Oct 19, 2022 at 8:16 PM Jeff Law via Gcc-patches wrote: > > > On 10/18/22 11:35, Palmer Dabbelt wrote: > > > >> I would have expected things to work fine with libcalls, perhaps with > >> the exception of the save/restore libcalls. So that needs deeper > >> investigation. > > > > The save/

Re: [PATCH] Enable shrink wrapping for the RISC-V target.

2022-11-02 Thread Manolis Tsamis
On Tue, Oct 18, 2022 at 8:35 PM Palmer Dabbelt wrote: > > On Tue, 18 Oct 2022 08:57:37 PDT (-0700), j...@ventanamicro.com wrote: > > > > Just a couple more comments in-line. > > > > On 10/18/22 09:18, Manolis Tsamis wrote: > >> > +/* Implement TARGET_SHRINK_WRAP_GET_SEPARATE_COMPONENTS. */ >

Re: [PATCH] Enable shrink wrapping for the RISC-V target.

2022-10-20 Thread Manolis Tsamis
On Wed, Oct 19, 2022 at 8:16 PM Jeff Law via Gcc-patches wrote: > > > On 10/18/22 11:35, Palmer Dabbelt wrote: > > > >> I would have expected things to work fine with libcalls, perhaps with > >> the exception of the save/restore libcalls. So that needs deeper > >> investigation. > > > > The save/

Re: [PATCH] Enable shrink wrapping for the RISC-V target.

2022-10-20 Thread Manolis Tsamis
On Tue, Oct 18, 2022 at 8:35 PM Palmer Dabbelt wrote: > > On Tue, 18 Oct 2022 08:57:37 PDT (-0700), j...@ventanamicro.com wrote: > > > > Just a couple more comments in-line. > > > > On 10/18/22 09:18, Manolis Tsamis wrote: > >> > +/* Implement TARGET_SHRINK_WRAP_GET_SEPARATE_COMPONENTS. */ >

Re: [PATCH] Enable shrink wrapping for the RISC-V target.

2022-10-19 Thread Jeff Law via Gcc-patches
On 10/18/22 11:35, Palmer Dabbelt wrote: I would have expected things to work fine with libcalls, perhaps with the exception of the save/restore libcalls.  So that needs deeper investigation. The save/restore libcalls only support saving/restoring a handful of register configurations (just

Re: [PATCH] Enable shrink wrapping for the RISC-V target.

2022-10-18 Thread Palmer Dabbelt
On Tue, 18 Oct 2022 08:57:37 PDT (-0700), j...@ventanamicro.com wrote: Just a couple more comments in-line. On 10/18/22 09:18, Manolis Tsamis wrote: +/* Implement TARGET_SHRINK_WRAP_GET_SEPARATE_COMPONENTS. */ + +static sbitmap +riscv_get_separate_components (void) +{ + HOST_WIDE_INT offse

Re: [PATCH] Enable shrink wrapping for the RISC-V target.

2022-10-18 Thread Jeff Law
Just a couple more comments in-line. On 10/18/22 09:18, Manolis Tsamis wrote: +/* Implement TARGET_SHRINK_WRAP_GET_SEPARATE_COMPONENTS. */ + +static sbitmap +riscv_get_separate_components (void) +{ + HOST_WIDE_INT offset; + sbitmap components = sbitmap_alloc (FIRST_PSEUDO_REGISTER); + bi

Re: [PATCH] Enable shrink wrapping for the RISC-V target.

2022-10-18 Thread Manolis Tsamis
On Sun, Oct 2, 2022 at 11:32 PM Palmer Dabbelt wrote: > > On Tue, 06 Sep 2022 03:39:02 PDT (-0700), manolis.tsa...@vrull.eu wrote: > > This commit implements the target macros (TARGET_SHRINK_WRAP_*) that > > enable separate shrink wrapping for function prologues/epilogues in > > RISC-V. > > > > Te

Re: [PATCH] Enable shrink wrapping for the RISC-V target.

2022-10-02 Thread Palmer Dabbelt
On Tue, 06 Sep 2022 03:39:02 PDT (-0700), manolis.tsa...@vrull.eu wrote: This commit implements the target macros (TARGET_SHRINK_WRAP_*) that enable separate shrink wrapping for function prologues/epilogues in RISC-V. Tested against SPEC CPU 2017, this change always has a net-positive effect on