Re: [PATCH 4/6] Shrink-wrapping

2011-08-27 Thread H.J. Lu
On Wed, Aug 24, 2011 at 9:46 AM, Bernd Schmidt wrote: > On 08/03/11 17:38, Richard Sandiford wrote: >> Bernd Schmidt writes: >>> +@findex simple_return >>> +@item (simple_return) >>> +Like @code{(return)}, but truly represents only a function return, while >>> +@code{(return)} may represent an in

Re: [PATCH 4/6] Shrink-wrapping

2011-08-26 Thread Ramana Radhakrishnan
On 26 August 2011 15:36, Bernd Schmidt wrote: > On 08/26/11 16:32, Ramana Radhakrishnan wrote: >> On 24 August 2011 18:23, Bernd Schmidt wrote: >>> On 08/24/11 19:17, Richard Sandiford wrote: > > You mean the introduction of simple_return patterns for ARM? The patch > is split up further (this on

Re: [PATCH 4/6] Shrink-wrapping

2011-08-26 Thread Bernd Schmidt
On 08/26/11 16:32, Ramana Radhakrishnan wrote: > On 24 August 2011 18:23, Bernd Schmidt wrote: >> On 08/24/11 19:17, Richard Sandiford wrote: >>> OK with that change from a MIPS and rtl and perspective. >> >> Thanks. What else is in there? Trivial x86 changes, and a slightly less >> trivial but st

Re: [PATCH 4/6] Shrink-wrapping

2011-08-26 Thread Ramana Radhakrishnan
On 24 August 2011 18:23, Bernd Schmidt wrote: > On 08/24/11 19:17, Richard Sandiford wrote: >> OK with that change from a MIPS and rtl and perspective. > > Thanks. What else is in there? Trivial x86 changes, and a slightly less > trivial but still tiny ARM bit, I suppose. Richard/Ramana? Sorry ab

Re: [PATCH 4/6] Shrink-wrapping

2011-08-24 Thread Bernd Schmidt
On 08/24/11 19:17, Richard Sandiford wrote: > OK with that change from a MIPS and rtl and perspective. Thanks. What else is in there? Trivial x86 changes, and a slightly less trivial but still tiny ARM bit, I suppose. Richard/Ramana? Bernd

Re: [PATCH 4/6] Shrink-wrapping

2011-08-24 Thread Richard Sandiford
Bernd Schmidt writes: > On 08/03/11 17:38, Richard Sandiford wrote: >> Bernd Schmidt writes: >>> +@findex simple_return >>> +@item (simple_return) >>> +Like @code{(return)}, but truly represents only a function return, while >>> +@code{(return)} may represent an insn that also performs other func

Re: [PATCH 4/6] Shrink-wrapping

2011-08-24 Thread Bernd Schmidt
On 08/03/11 17:38, Richard Sandiford wrote: > Bernd Schmidt writes: >> +@findex simple_return >> +@item (simple_return) >> +Like @code{(return)}, but truly represents only a function return, while >> +@code{(return)} may represent an insn that also performs other functions >> +of the function epil

Re: [PATCH 4/6] Shrink-wrapping

2011-08-03 Thread Richard Sandiford
Bernd Schmidt writes: > +@findex simple_return > +@item (simple_return) > +Like @code{(return)}, but truly represents only a function return, while > +@code{(return)} may represent an insn that also performs other functions > +of the function epilogue. Like @code{(return)}, this may also occur in

Re: [PATCH 4/6] Shrink-wrapping

2011-08-03 Thread Bernd Schmidt
On 08/03/11 12:41, Alan Modra wrote: > This patch makes rebuild_jump_labels set JUMP_LABEL appropriately > for return jumps, and fixes sharing for RETURN. Since ANY_RETURN_P(X) > is defined as ((X) == ret_rtx), RETURNs need to stay shared. > Bootstrapped and regression tested powerpc-linux and pow

Re: [PATCH 4/6] Shrink-wrapping

2011-08-03 Thread Alan Modra
On Thu, Jul 28, 2011 at 12:35:46PM +0200, Bernd Schmidt wrote: [snip] > * rtl.h (ANY_RETURN_P): New macro. [snip] This patch makes rebuild_jump_labels set JUMP_LABEL appropriately for return jumps, and fixes sharing for RETURN. Since ANY_RETURN_P(X) is defined as ((X) == ret_rtx), RETURNs n

Re: [PATCH 4/6] Shrink-wrapping

2011-08-02 Thread Bernd Schmidt
On 07/07/11 16:34, Richard Sandiford wrote: > I didn't review much after this, because it was hard to sort the > simple_return stuff out from the "JUMP_LABEL can be a return rtx" change. So, here's a second preliminary patch. Now that we have returns in JUMP_LABELs, we can introduce SIMPLE_RETURN

Re: [PATCH 4/6] Shrink-wrapping

2011-07-29 Thread Bernd Schmidt
On 07/29/11 00:31, Richard Earnshaw wrote: > This causes http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49891 Fixed with this. Bernd Index: gcc/ChangeLog === --- gcc/ChangeLog (revision 176904) +++ gcc/ChangeLog (working c

Re: [PATCH 4/6] Shrink-wrapping

2011-07-28 Thread Richard Earnshaw
On 28/07/11 11:35, Bernd Schmidt wrote: > On 07/21/11 11:52, Richard Sandiford wrote: >> The name "active_insn_after" seems a bit too similar to "next_active_insn" >> for the difference to be obvious. How about something like >> "first_active_target_insn" instead? > > Changed. >>> - for (; insn;

Re: [PATCH 4/6] Shrink-wrapping

2011-07-28 Thread Richard Sandiford
Bernd Schmidt writes: >>> - for (; insn; insn = next) >>> + for (; insn && !ANY_RETURN_P (insn); insn = next) >>> { >>>if (NONJUMP_INSN_P (insn) && GET_CODE (PATTERN (insn)) == SEQUENCE) >>> insn = XVECEXP (PATTERN (insn), 0, 0); >> >> Since ANY_RETURN looks for patterns, while

Re: [PATCH 4/6] Shrink-wrapping

2011-07-28 Thread Bernd Schmidt
On 07/21/11 11:52, Richard Sandiford wrote: > The name "active_insn_after" seems a bit too similar to "next_active_insn" > for the difference to be obvious. How about something like > "first_active_target_insn" instead? Changed. >> - for (; insn; insn = next) >> + for (; insn && !ANY_RETURN_P (

Re: [PATCH 4/6] Shrink-wrapping

2011-07-21 Thread Richard Sandiford
Bernd Schmidt writes: > On 07/07/11 16:34, Richard Sandiford wrote: >> Is JUMP_LABEL ever null after this change? (In fully-complete rtl >> sequences, I mean.) It looked like some of the null checks in the >> patch might not be necessary any more. > > It turns out that computed jumps can have a

Re: [PATCH 4/6] Shrink-wrapping

2011-07-20 Thread Bernd Schmidt
On 07/07/11 16:34, Richard Sandiford wrote: > Is JUMP_LABEL ever null after this change? (In fully-complete rtl > sequences, I mean.) It looked like some of the null checks in the > patch might not be necessary any more. It turns out that computed jumps can have a NULL JUMP_LABEL, and so can JUM

Re: [PATCH 4/6] Shrink-wrapping

2011-07-11 Thread Bernd Schmidt
On 07/11/11 13:08, Richard Sandiford wrote: > Bernd Schmidt writes: >> On 07/07/11 22:08, Richard Sandiford wrote: >>> Sure, I understand that returns does more than return on ARM. >>> What I meant was: we'd normally want that other stuff to be >>> expressed in rtl alongside the (return) rtx. E.g

Re: [PATCH 4/6] Shrink-wrapping

2011-07-11 Thread Richard Sandiford
Bernd Schmidt writes: > On 07/07/11 22:08, Richard Sandiford wrote: >> Sure, I understand that returns does more than return on ARM. >> What I meant was: we'd normally want that other stuff to be >> expressed in rtl alongside the (return) rtx. E.g. something like: >> >> (parallel >> [(retu

Re: [PATCH 4/6] Shrink-wrapping

2011-07-08 Thread Bernd Schmidt
On 07/07/11 22:08, Richard Sandiford wrote: > Sure, I understand that returns does more than return on ARM. > What I meant was: we'd normally want that other stuff to be > expressed in rtl alongside the (return) rtx. E.g. something like: > > (parallel > [(return) > (set (reg r4) (mem (

Re: [PATCH 4/6] Shrink-wrapping

2011-07-08 Thread Richard Earnshaw
On 07/07/11 21:08, Richard Sandiford wrote: > Richard Earnshaw writes: >> On 07/07/11 15:34, Richard Sandiford wrote: >>> It seems a shame to have both (return) and (simple_return). You said >>> that we need the distinction in order to cope with targets like ARM, >>> whose (return) instruction ac

Re: [PATCH 4/6] Shrink-wrapping

2011-07-07 Thread Richard Sandiford
Richard Earnshaw writes: > On 07/07/11 15:34, Richard Sandiford wrote: >> It seems a shame to have both (return) and (simple_return). You said >> that we need the distinction in order to cope with targets like ARM, >> whose (return) instruction actually performs some of the epilogue too. >> It fe

Re: [PATCH 4/6] Shrink-wrapping

2011-07-07 Thread Bernd Schmidt
On 07/07/11 19:05, Paul Koning wrote: > From a note by Richard Henderson (June 30, 2011) it sounds like > rs6000 is the other platform that still generates asm prologues. But > yes, I said I would do this. It sounds like doing it soon would help > Bernd a lot. Let me try to accelerate it. Maybe

Re: [PATCH 4/6] Shrink-wrapping

2011-07-07 Thread Jeff Law
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 07/07/11 11:05, Paul Koning wrote: > > On Jul 7, 2011, at 1:00 PM, Jeff Law wrote: > >> -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 >> >> On 07/07/11 10:58, Paul Koning wrote: >>> >>> On Jul 7, 2011, at 11:38 AM, Bernd Schmidt wrote: >>>

Re: [PATCH 4/6] Shrink-wrapping

2011-07-07 Thread Paul Koning
On Jul 7, 2011, at 1:00 PM, Jeff Law wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > On 07/07/11 10:58, Paul Koning wrote: >> >> On Jul 7, 2011, at 11:38 AM, Bernd Schmidt wrote: >> >>> ... >>> It'd also be nice to get rid of all these big blocks of code that are condit

Re: [PATCH 4/6] Shrink-wrapping

2011-07-07 Thread Jeff Law
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 07/07/11 10:58, Paul Koning wrote: > > On Jul 7, 2011, at 11:38 AM, Bernd Schmidt wrote: > >> ... >> >>> It'd also be nice to get rid of all these big blocks of code that are >>> conditional on preprocessor macros, but I realise you're just follow

Re: [PATCH 4/6] Shrink-wrapping

2011-07-07 Thread Paul Koning
On Jul 7, 2011, at 11:38 AM, Bernd Schmidt wrote: > ... > >> It'd also be nice to get rid of all these big blocks of code that are >> conditional on preprocessor macros, but I realise you're just following >> existing practice in the surrounding code, so again it can be left to >> a future clean

Re: [PATCH 4/6] Shrink-wrapping

2011-07-07 Thread Richard Earnshaw
On 07/07/11 15:34, Richard Sandiford wrote: > It seems a shame to have both (return) and (simple_return). You said > that we need the distinction in order to cope with targets like ARM, > whose (return) instruction actually performs some of the epilogue too. > It feels like the load of the saved r

Re: [PATCH 4/6] Shrink-wrapping

2011-07-07 Thread Bernd Schmidt
Whee! Thanks for reviewing (reviving?) this old thing. I should be posting an up-to-date version of this, but for the moment it has to wait until dwarf2out is sorted out, and I'm rather busy with other stuff. I hope to squeeze this in in the not too distant future. I'll try to answer some of the

Re: [PATCH 4/6] Shrink-wrapping

2011-07-07 Thread Richard Sandiford
Bernd Schmidt writes: > This adds the actual optimization, and reworks the JUMP_LABEL handling > for return blocks. See the introduction mail or the new comment ahead of > thread_prologue_and_epilogue_insns for more notes. It seems a shame to have both (return) and (simple_return). You said that