Re: [PATCH 5/9] regrename: Don't run if function was separately shrink-wrapped

2016-09-19 Thread Segher Boessenkool
Hi Jeff, On Wed, Sep 14, 2016 at 01:33:04PM -0600, Jeff Law wrote: > On 09/14/2016 01:03 PM, Segher Boessenkool wrote: > >>If you think about it, conceptually we want the return insn to make the > >>callee saved registers "used" so that DCE, regrename and friends don't > >>muck with them. The fac

Re: [PATCH 5/9] regrename: Don't run if function was separately shrink-wrapped

2016-09-15 Thread Jeff Law
On 09/14/2016 04:11 PM, Segher Boessenkool wrote: On Wed, Sep 14, 2016 at 01:33:04PM -0600, Jeff Law wrote: On 09/14/2016 01:03 PM, Segher Boessenkool wrote: If you think about it, conceptually we want the return insn to make the callee saved registers "used" so that DCE, regrename and friends

Re: [PATCH 5/9] regrename: Don't run if function was separately shrink-wrapped

2016-09-14 Thread Segher Boessenkool
On Wed, Sep 14, 2016 at 01:35:57PM -0600, Jeff Law wrote: > On 09/14/2016 01:03 PM, Segher Boessenkool wrote: > > > >(There is no return insn at those exits; these are exits *without* > >successor block, not the exit block). > Hmm, I thought these were return blocks, but you're saying they're > no

Re: [PATCH 5/9] regrename: Don't run if function was separately shrink-wrapped

2016-09-14 Thread Segher Boessenkool
On Wed, Sep 14, 2016 at 01:33:04PM -0600, Jeff Law wrote: > On 09/14/2016 01:03 PM, Segher Boessenkool wrote: > >>If you think about it, conceptually we want the return insn to make the > >>callee saved registers "used" so that DCE, regrename and friends don't > >>muck with them. The fact that we

Re: [PATCH 5/9] regrename: Don't run if function was separately shrink-wrapped

2016-09-14 Thread Jeff Law
On 09/14/2016 01:03 PM, Segher Boessenkool wrote: (There is no return insn at those exits; these are exits *without* successor block, not the exit block). Hmm, I thought these were return blocks, but you're saying they're no-return blocks? I missed that. In that case, aren't the restores dea

Re: [PATCH 5/9] regrename: Don't run if function was separately shrink-wrapped

2016-09-14 Thread Jeff Law
On 09/14/2016 01:03 PM, Segher Boessenkool wrote: If you think about it, conceptually we want the return insn to make the callee saved registers "used" so that DCE, regrename and friends don't muck with them. The fact that we don't is as much never having to care all that much until recently.

Re: [PATCH 5/9] regrename: Don't run if function was separately shrink-wrapped

2016-09-14 Thread Jeff Law
On 09/14/2016 01:10 PM, Segher Boessenkool wrote: On Wed, Sep 14, 2016 at 11:52:02AM -0600, Jeff Law wrote: Yea, it'll certainly do that and I can imagine a design which would have that property. And there's other designs which benefit from spreading across the register file as much as possible

Re: [PATCH 5/9] regrename: Don't run if function was separately shrink-wrapped

2016-09-14 Thread Segher Boessenkool
On Wed, Sep 14, 2016 at 11:52:02AM -0600, Jeff Law wrote: > Yea, it'll certainly do that and I can imagine a design which would have > that property. And there's other designs which benefit from spreading > across the register file as much as possible. > > Which argues there needs to be a way t

Re: [PATCH 5/9] regrename: Don't run if function was separately shrink-wrapped

2016-09-14 Thread Segher Boessenkool
On Wed, Sep 14, 2016 at 12:11:50PM -0600, Jeff Law wrote: > On 09/14/2016 07:04 AM, Segher Boessenkool wrote: > >>I'd > >>probably start by fixing the dataflow issues and see if that fixes the > >>regrename thing as a side effect. > > > >Have you seen https://gcc.gnu.org/ml/gcc-patches/2016-07/msg0

Re: [PATCH 5/9] regrename: Don't run if function was separately shrink-wrapped

2016-09-14 Thread Jeff Law
On 09/14/2016 08:01 AM, Bernd Schmidt wrote: On 09/14/2016 03:55 PM, Segher Boessenkool wrote: On Wed, Sep 14, 2016 at 03:08:21PM +0200, Bernd Schmidt wrote: The data that was posted showed a code size decrease on a number of targets. I'm really not sure where this irrational hate for regrename

Re: [PATCH 5/9] regrename: Don't run if function was separately shrink-wrapped

2016-09-14 Thread Jeff Law
On 09/14/2016 07:04 AM, Segher Boessenkool wrote: I'd probably start by fixing the dataflow issues and see if that fixes the regrename thing as a side effect. Have you seen https://gcc.gnu.org/ml/gcc-patches/2016-07/msg00091.html ? I missed it. My interpretation The uses at each "strange

Re: [PATCH 5/9] regrename: Don't run if function was separately shrink-wrapped

2016-09-14 Thread Jeff Law
On 09/14/2016 07:55 AM, Segher Boessenkool wrote: On Wed, Sep 14, 2016 at 03:08:21PM +0200, Bernd Schmidt wrote: On 09/14/2016 03:04 PM, Segher Boessenkool wrote: Then rs6000 (and many other ports probably) will just turn it off again. It is actively harmful. The data that was posted showed a

Re: [PATCH 5/9] regrename: Don't run if function was separately shrink-wrapped

2016-09-14 Thread Segher Boessenkool
Hi Bernd, On Wed, Sep 14, 2016 at 04:01:34PM +0200, Bernd Schmidt wrote: > On 09/14/2016 03:55 PM, Segher Boessenkool wrote: > >On Wed, Sep 14, 2016 at 03:08:21PM +0200, Bernd Schmidt wrote: > >>The data that was posted showed a code size decrease on a number of > >>targets. I'm really not sure wh

Re: [PATCH 5/9] regrename: Don't run if function was separately shrink-wrapped

2016-09-14 Thread Bernd Schmidt
On 09/14/2016 03:55 PM, Segher Boessenkool wrote: On Wed, Sep 14, 2016 at 03:08:21PM +0200, Bernd Schmidt wrote: The data that was posted showed a code size decrease on a number of targets. I'm really not sure where this irrational hate for regrename comes from. It increases the number of acti

Re: [PATCH 5/9] regrename: Don't run if function was separately shrink-wrapped

2016-09-14 Thread Segher Boessenkool
On Wed, Sep 14, 2016 at 03:08:21PM +0200, Bernd Schmidt wrote: > On 09/14/2016 03:04 PM, Segher Boessenkool wrote: > >Then rs6000 (and many other ports probably) will just turn it off again. > >It is actively harmful. > > The data that was posted showed a code size decrease on a number of > targe

Re: [PATCH 5/9] regrename: Don't run if function was separately shrink-wrapped

2016-09-14 Thread Bernd Schmidt
On 09/14/2016 03:04 PM, Segher Boessenkool wrote: Then rs6000 (and many other ports probably) will just turn it off again. It is actively harmful. The data that was posted showed a code size decrease on a number of targets. I'm really not sure where this irrational hate for regrename comes fr

Re: [PATCH 5/9] regrename: Don't run if function was separately shrink-wrapped

2016-09-14 Thread Segher Boessenkool
On Mon, Sep 12, 2016 at 10:33:22AM -0600, Jeff Law wrote: > The answer is to debug the problem, and yes it may be painful. Yes, the three weeks pretty much full-time I spent on that already attest to that. > I'd > probably start by fixing the dataflow issues and see if that fixes the > regrenam

Re: [PATCH 5/9] regrename: Don't run if function was separately shrink-wrapped

2016-09-12 Thread Jeff Law
On 09/12/2016 10:54 AM, David Edelsohn wrote: On Sep 12, 2016 17:33, "Jeff Law" mailto:l...@redhat.com>> wrote: On 09/10/2016 12:40 AM, Segher Boessenkool wrote: On Fri, Sep 09, 2016 at 05:01:19PM -0600, Jeff Law wrote: On 09/09/2016 02:41 PM, Segher Boessenkool wrote: On Fri, Sep 09, 201

Re: [PATCH 5/9] regrename: Don't run if function was separately shrink-wrapped

2016-09-12 Thread Jeff Law
On 09/10/2016 12:40 AM, Segher Boessenkool wrote: On Fri, Sep 09, 2016 at 05:01:19PM -0600, Jeff Law wrote: On 09/09/2016 02:41 PM, Segher Boessenkool wrote: On Fri, Sep 09, 2016 at 12:31:31PM -0600, Jeff Law wrote: On 06/08/2016 03:18 AM, Bernd Schmidt wrote: On 06/08/2016 03:47 AM, Segher B

Re: [PATCH 5/9] regrename: Don't run if function was separately shrink-wrapped

2016-09-09 Thread Segher Boessenkool
On Fri, Sep 09, 2016 at 05:01:19PM -0600, Jeff Law wrote: > On 09/09/2016 02:41 PM, Segher Boessenkool wrote: > >On Fri, Sep 09, 2016 at 12:31:31PM -0600, Jeff Law wrote: > >>On 06/08/2016 03:18 AM, Bernd Schmidt wrote: > >>>On 06/08/2016 03:47 AM, Segher Boessenkool wrote: > + /* regrenam

Re: [PATCH 5/9] regrename: Don't run if function was separately shrink-wrapped

2016-09-09 Thread Jeff Law
On 09/09/2016 02:41 PM, Segher Boessenkool wrote: On Fri, Sep 09, 2016 at 12:31:31PM -0600, Jeff Law wrote: On 06/08/2016 03:18 AM, Bernd Schmidt wrote: On 06/08/2016 03:47 AM, Segher Boessenkool wrote: + /* regrename creates wrong code for exception handling, if used together + w

Re: [PATCH 5/9] regrename: Don't run if function was separately shrink-wrapped

2016-09-09 Thread Segher Boessenkool
On Fri, Sep 09, 2016 at 12:31:31PM -0600, Jeff Law wrote: > On 06/08/2016 03:18 AM, Bernd Schmidt wrote: > >On 06/08/2016 03:47 AM, Segher Boessenkool wrote: > >>+ /* regrename creates wrong code for exception handling, if used > >>together > >>+ with separate shrink-wrapping. Disable

Re: [PATCH 5/9] regrename: Don't run if function was separately shrink-wrapped

2016-09-09 Thread Jeff Law
On 06/08/2016 03:18 AM, Bernd Schmidt wrote: On 06/08/2016 03:47 AM, Segher Boessenkool wrote: + /* regrename creates wrong code for exception handling, if used together + with separate shrink-wrapping. Disable for now, until we have + figured out what exactly is going on. */

Re: [PATCH 5/9] regrename: Don't run if function was separately shrink-wrapped

2016-09-08 Thread Jeff Law
On 07/31/2016 07:42 PM, Segher Boessenkool wrote: Unfortunately even after the previous patch there are still a few cases where regrename creates invalid code when used together with separate shrink-wrapping. At noreturn exits regrename thinks it can use all callee-saved registers, but that is n

[PATCH 5/9] regrename: Don't run if function was separately shrink-wrapped

2016-07-31 Thread Segher Boessenkool
Unfortunately even after the previous patch there are still a few cases where regrename creates invalid code when used together with separate shrink-wrapping. At noreturn exits regrename thinks it can use all callee-saved registers, but that is not true. This patch disables regrename for function

Re: [PATCH 5/9] regrename: Don't run if function was separately shrink-wrapped

2016-06-08 Thread Bernd Schmidt
On 06/08/2016 03:47 AM, Segher Boessenkool wrote: + /* regrename creates wrong code for exception handling, if used together + with separate shrink-wrapping. Disable for now, until we have +figured out what exactly is going on. */ That needs to be figured out now or it'll

[PATCH 5/9] regrename: Don't run if function was separately shrink-wrapped

2016-06-07 Thread Segher Boessenkool
Unfortunately even after the previous patch there are still a few cases where regrename creates invalid code when used together with separate shrink-wrapping. I haven't found the cause of those. This patch disables regrename for functions that were separately shrink-wrapped. 2016-06-07 Segher