public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jeff Law <law@redhat.com>
To: Segher Boessenkool <segher@kernel.crashing.org>
Cc: Bernd Schmidt <bschmidt@redhat.com>,
	gcc-patches@gcc.gnu.org,        dje.gcc@gmail.com
Subject: Re: [PATCH 5/9] regrename: Don't run if function was separately shrink-wrapped
Date: Wed, 14 Sep 2016 19:38:00 -0000	[thread overview]
Message-ID: <92f35909-2f70-487a-5e24-d38bff9daa4b@redhat.com> (raw)
In-Reply-To: <20160914190353.GA22273@gate.crashing.org>

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.
>
> (There is no return insn at those exits; these are exits *without*
> successor block, not the exit block).
Ugh.  Anywhere we could attach this stuff in the insn chain?  If not, 
the DF side of this problem gets uglier.

>
> It is puzzling to me why adding USEs for just the registers that *are*
> separately shrink-wrapped does not work; only all those that *could* be
> shrink-wrapped does.  Do you have any idea about that?
Nope.  No clue on that one.  It almost seems like a book-keeping error 
somewhere.

>
>> I continue to wonder if we could add something similar to
>> CALL_INSN_FUNCTION_USAGE where we attach uses for all the call-saved
>> registers onto a return insn.  We would attach them at the end of
>> prologue/epilogue generation and only attach those where were live
>> somewhere in the code.
>
> Maybe adding the new insns to the {pro,epi}logue_insn_hash will help
> something.  Or maybe it will blow up spectacularly.  Will know in a
> bit.
I think that'll resolve the sel-sched issue, but I doubt the rest.

>
>> I pondered just doing it for the separately wrapped components on that
>> particular path, but I've yet to convince myself that's actually correct.
>
> If that is not correct, how is the status quo correct?  That is what
> puzzles me above, too.
I couldn't convince myself that we could trivially find all the 
separately wrapped components on a particular path -- ie, we may have 
had components saved/restored in some sub-graph.  If an exit point from 
the function is reachable from that sub-graph, then we need to make sure 
any components from the subgraph are marked as live in addition to those 
which are restored on the exit path.

While it is just a reachability problem, I don't think we need to solve 
it if we mark anything that was separately shrink wrapped as live at all 
the exit points.


>
> There is a well-defined way to turn it off, via common/config/*/*-common.c ,
> TARGET_OPTION_OPTIMIZATION_TABLE.  We disagree on whether most targets will
> want it enabled, i.e. whether it should (eventually) be enabled by default.
I'm aware of TARGET_OPTION_OPTIMIZATION_TABLE -- I was thinking more 
along the lines of trying to describe the conditions under which it is 
not profitable and expose that.  TARGET_OPTION_OPTIMIZATION_TABLE is a 
lame way to attack this problem.

Jeff

  reply	other threads:[~2016-09-14 19:33 UTC|newest]

Thread overview: 62+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-08  1:48 [PATCH 0/9] separate shrink-wrapping Segher Boessenkool
2016-06-08  1:48 ` [PATCH 3/9] dce: Don't dead-code delete separately wrapped restores Segher Boessenkool
2016-06-08  1:48 ` [PATCH 1/9] separate shrink-wrap: New command-line flag, status flag, hooks, and doc Segher Boessenkool
2016-06-08  1:48 ` [PATCH 2/9] cfgcleanup: Don't confuse CFI when -fshrink-wrap-separate Segher Boessenkool
2016-06-08  1:53 ` [PATCH 4/9] regrename: Don't rename restores Segher Boessenkool
2016-06-08  1:53 ` [PATCH 6/9] sel-sched: Don't mess with register restores Segher Boessenkool
2016-06-08  1:54 ` [PATCH 5/9] regrename: Don't run if function was separately shrink-wrapped Segher Boessenkool
2016-06-08  9:18   ` Bernd Schmidt
2016-09-09 18:41     ` Jeff Law
2016-09-09 20:56       ` Segher Boessenkool
2016-09-09 23:12         ` Jeff Law
2016-09-10  6:59           ` Segher Boessenkool
2016-09-12 16:36             ` Jeff Law
     [not found]               ` <CAGWvny=fHHZtKF4_D2098+3PTPPzxtg3EjKDWHyJwUxz8g_tEA@mail.gmail.com>
     [not found]                 ` <CAGWvnymZVg_FR_PHqhwkgrAkHDntVMEiG4shfst_GA9OnZKvWg@mail.gmail.com>
     [not found]                   ` <CAGWvnykQ3oz0UpcF6U1WYivbJww65h2EH5n3FocQ8JGY9hrOrA@mail.gmail.com>
2016-09-12 17:04                     ` Jeff Law
2016-09-14 13:08               ` Segher Boessenkool
2016-09-14 13:18                 ` Bernd Schmidt
2016-09-14 14:01                   ` Segher Boessenkool
2016-09-14 14:54                     ` Bernd Schmidt
2016-09-14 16:33                       ` Segher Boessenkool
2016-09-14 19:10                       ` Jeff Law
2016-09-14 17:55                     ` Jeff Law
2016-09-14 19:13                       ` Segher Boessenkool
2016-09-14 19:36                         ` Jeff Law
2016-09-14 18:21                 ` Jeff Law
2016-09-14 19:13                   ` Segher Boessenkool
2016-09-14 19:38                     ` Jeff Law [this message]
2016-09-14 22:34                       ` Segher Boessenkool
2016-09-15 17:28                         ` Jeff Law
2016-09-19 17:11                       ` Segher Boessenkool
2016-09-14 20:04                     ` Jeff Law
2016-09-14 22:51                       ` Segher Boessenkool
2016-06-08  1:54 ` [PATCH 7/9] cprop: Leave RTX_FRAME_RELATED_P instructions alone Segher Boessenkool
2016-06-08  2:03 ` [PATCH 8/9] shrink-wrap: shrink-wrapping for separate concerns Segher Boessenkool
2016-07-15 12:42   ` Bernd Schmidt
2016-07-18 16:34     ` Segher Boessenkool
2016-07-18 17:03       ` Bernd Schmidt
2016-07-19 14:46         ` Segher Boessenkool
2016-07-19 14:49           ` Bernd Schmidt
2016-07-19 15:35             ` Segher Boessenkool
2016-07-20 11:23               ` Bernd Schmidt
2016-07-20 15:06                 ` Segher Boessenkool
2016-06-08  2:04 ` [PATCH 9/9] rs6000: Separate shrink-wrapping Segher Boessenkool
2016-06-08 11:56 ` [PATCH 0/9] separate shrink-wrapping Bernd Schmidt
2016-06-08 12:45   ` Eric Botcazou
2016-06-08 15:16   ` Segher Boessenkool
2016-06-08 16:43     ` Bernd Schmidt
2016-06-08 17:26       ` Segher Boessenkool
2016-06-29 23:06         ` Bernd Schmidt
2016-06-29 23:24           ` Segher Boessenkool
2016-07-04  8:57             ` Segher Boessenkool
2016-06-14 21:24       ` Segher Boessenkool
2016-07-08 10:42         ` Bernd Schmidt
2016-07-08 12:11           ` Segher Boessenkool
2016-07-08 13:16             ` David Malcolm
2016-07-08 13:45               ` Segher Boessenkool
2016-07-08 14:35                 ` Bill Schmidt
2016-06-09 16:12 ` Jeff Law
2016-06-09 19:57   ` Segher Boessenkool
2016-06-28  0:22 ` PING " Segher Boessenkool
2016-07-07 10:16   ` PING x2 " Segher Boessenkool
2016-08-01  1:43 [PATCH v2 0/9] Separate shrink-wrapping Segher Boessenkool
2016-08-01  2:12 ` [PATCH 5/9] regrename: Don't run if function was separately shrink-wrapped Segher Boessenkool
2016-09-08 17:54   ` Jeff Law

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=92f35909-2f70-487a-5e24-d38bff9daa4b@redhat.com \
    --to=law@redhat.com \
    --cc=bschmidt@redhat.com \
    --cc=dje.gcc@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=segher@kernel.crashing.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).