Re: [PATCH 2/2] shrink-wrap: Rewrite try_shrink_wrapping

2015-09-15 Thread H.J. Lu
On Thu, Sep 10, 2015 at 8:14 AM, Segher Boessenkool wrote: > This patch rewrites the shrink-wrapping algorithm, allowing non-linear > pieces of CFG to be duplicated for use without prologue instead of just > linear pieces. > > On PowerPC, this enables shrink-wrapping

Re: [PATCH 2/2] shrink-wrap: Rewrite try_shrink_wrapping

2015-09-14 Thread Segher Boessenkool
On Fri, Sep 11, 2015 at 03:40:53PM +0100, Jiong Wang wrote: > >> A quick check shows > 30% more functions shrink-wrapped during > >> bootstrapping by a the following command: > >> > >> cd $TOP_BUILD ; find . -name "*.pro_and_epilogue" | xargs grep > >> "Perform.*shrink" | wc -l > > > > Wow, that

Re: [PATCH 2/2] shrink-wrap: Rewrite try_shrink_wrapping

2015-09-11 Thread Bernd Schmidt
On 09/10/2015 05:14 PM, Segher Boessenkool wrote: This patch rewrites the shrink-wrapping algorithm, allowing non-linear pieces of CFG to be duplicated for use without prologue instead of just linear pieces. An example would be good for this kind of patch, also in the comments. -

Re: [PATCH 2/2] shrink-wrap: Rewrite try_shrink_wrapping

2015-09-11 Thread Jiong Wang
Segher Boessenkool writes: > On Thu, Sep 10, 2015 at 08:14:29AM -0700, Segher Boessenkool wrote: >> This patch rewrites the shrink-wrapping algorithm, allowing non-linear >> pieces of CFG to be duplicated for use without prologue instead of just >> linear pieces. > >> Bootstrapped and regression

Re: [PATCH 2/2] shrink-wrap: Rewrite try_shrink_wrapping

2015-09-11 Thread Segher Boessenkool
On Fri, Sep 11, 2015 at 10:24:42AM +0100, Jiong Wang wrote: > > Segher Boessenkool writes: > > > On Thu, Sep 10, 2015 at 08:14:29AM -0700, Segher Boessenkool wrote: > >> This patch rewrites the shrink-wrapping algorithm, allowing non-linear > >> pieces of CFG to be duplicated for use without

Re: [PATCH 2/2] shrink-wrap: Rewrite try_shrink_wrapping

2015-09-11 Thread Segher Boessenkool
On Fri, Sep 11, 2015 at 11:19:40AM +0200, Bernd Schmidt wrote: > On 09/10/2015 05:14 PM, Segher Boessenkool wrote: > >This patch rewrites the shrink-wrapping algorithm, allowing non-linear > >pieces of CFG to be duplicated for use without prologue instead of just > >linear pieces. > > An example

Re: [PATCH 2/2] shrink-wrap: Rewrite try_shrink_wrapping

2015-09-11 Thread Bernd Schmidt
On 09/11/2015 02:36 PM, Segher Boessenkool wrote: I'm wondering how your new algorithm prevents the prologue from being placed inside a loop. Can you have a situation where this picks a predecessor that is reachable but not dominated by PRO? It doesn't prevent it! The prologue will not be

Re: [PATCH 2/2] shrink-wrap: Rewrite try_shrink_wrapping

2015-09-11 Thread Jiong Wang
Segher Boessenkool writes: > On Fri, Sep 11, 2015 at 10:24:42AM +0100, Jiong Wang wrote: >> >> Segher Boessenkool writes: >> >> > On Thu, Sep 10, 2015 at 08:14:29AM -0700, Segher Boessenkool wrote: >> >> This patch rewrites the shrink-wrapping algorithm, allowing non-linear >> >> pieces of CFG

Re: [PATCH 2/2] shrink-wrap: Rewrite try_shrink_wrapping

2015-09-10 Thread Segher Boessenkool
On Thu, Sep 10, 2015 at 04:22:34PM +0100, Jiong Wang wrote: > > Segher Boessenkool writes: > > > 2015-09-10 Segher Boessenkool > > > > * shrink-wrap.c (requires_stack_frame_p): Fix formatting. > > (dup_block_and_redirect): Delete function. > >

[PATCH 2/2] shrink-wrap: Rewrite try_shrink_wrapping

2015-09-10 Thread Segher Boessenkool
This patch rewrites the shrink-wrapping algorithm, allowing non-linear pieces of CFG to be duplicated for use without prologue instead of just linear pieces. On PowerPC, this enables shrink-wrapping of about 2%-3% more functions. I expected more, but in most cases this would help we cannot yet

Re: [PATCH 2/2] shrink-wrap: Rewrite try_shrink_wrapping

2015-09-10 Thread Jiong Wang
Segher Boessenkool writes: > 2015-09-10 Segher Boessenkool > > * shrink-wrap.c (requires_stack_frame_p): Fix formatting. > (dup_block_and_redirect): Delete function. > (can_dup_for_shrink_wrapping): New function. >

Re: [PATCH 2/2] shrink-wrap: Rewrite try_shrink_wrapping

2015-09-10 Thread Segher Boessenkool
On Thu, Sep 10, 2015 at 10:41:53AM -0500, Segher Boessenkool wrote: > > > * shrink-wrap.c (requires_stack_frame_p): Fix formatting. > > > (dup_block_and_redirect): Delete function. > > > (can_dup_for_shrink_wrapping): New function. > > > (fix_fake_fallthrough_edge):

Re: [PATCH 2/2] shrink-wrap: Rewrite try_shrink_wrapping

2015-09-10 Thread Segher Boessenkool
On Thu, Sep 10, 2015 at 08:14:29AM -0700, Segher Boessenkool wrote: > This patch rewrites the shrink-wrapping algorithm, allowing non-linear > pieces of CFG to be duplicated for use without prologue instead of just > linear pieces. > Bootstrapped and regression tested on powerpc64-linux. Is this