public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Andrew Burgess <andrew.burgess@embecosm.com>
To: Jeff Law <law@redhat.com>
Cc: Jakub Jelinek <jakub@redhat.com>, gcc-patches@gcc.gnu.org
Subject: Re: Ping: Re: [PATCH 1/2] gcc: Remove unneeded global flag.
Date: Fri, 28 Oct 2016 16:15:00 -0000	[thread overview]
Message-ID: <20161028161446.GU19319@embecosm.com> (raw)
In-Reply-To: <83361ec2-14a4-f2c5-c703-a9ad75af0ab6@redhat.com>

* Jeff Law <law@redhat.com> [2016-10-28 09:58:14 -0600]:

> On 09/15/2016 08:24 AM, Andrew Burgess wrote:
> > * Jakub Jelinek <jakub@redhat.com> [2016-09-14 15:07:56 +0200]:
> > 
> > > On Wed, Sep 14, 2016 at 02:00:48PM +0100, Andrew Burgess wrote:
> > > > In an attempt to get this patch merged (as I still think that its
> > > > correct) I've investigated, and documented a little more about how I
> > > > think things currently work.  I'm sure most people reading this will
> > > > already know this, but hopefully, if my understanding is wrong someone
> > > > can point it out.
> > > 
> > > I wonder if user_defined_section_attribute instead shouldn't be moved
> > > into struct function and be handled as a per-function flag then.
> > 
> > That would certainly solve the problem I'm trying to address.  But I
> > wonder, how is that different to looking for a section attribute on
> > the function DECL?
> I'm not sure it is significantly different.  It seems like it's just an
> implementation detail.  I'd err on the side of putting this into the struct
> function rather than on the DECL node simply to keep the size of DECL nodes
> from increasing.  Even if you can find suitable free flag bits, those can
> likely be better used for other purposes.

I didn't add anything to the DECL, the information we need is already
there.  The relevant chunk of the patch is:

@@ -2890,7 +2889,7 @@ pass_partition_blocks::gate (function *fun)
             we are going to omit the reordering.  */
          && optimize_function_for_speed_p (fun)
          && !DECL_COMDAT_GROUP (current_function_decl)
-	  && !user_defined_section_attribute);
+	  && !lookup_attribute ("section", DECL_ATTRIBUTES (fun->decl)));
 unsigned

I have not made any changes to add anything new to the DECL.  I guess
an argument _could_ be made that looking up an attribute is too
expensive to be used in a pass::gate function (I haven't looked into
how expensive it is) but I figured that initially at least it's better
to reuse the data we already have around than to add a new flag that
duplicates something we already have.

> I'm still pondering the actual patch.  It's not forgotten.

Would it help clarify things if I added some printf style tracing and
posted a trace?  This might help highlight how
USER_DEFINED_SECTION_ATTRIBUTE is set in a different phase of
compilation and so can't possibly be of any use when deciding whether
or not to perform the pass or not.

I'm still keen to see this merged, so any extra leg work I can do to
help move this forward, please let me know; I'm happy to help.

Thanks,
Andrew

  reply	other threads:[~2016-10-28 16:15 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-10 16:56 [PATCH 0/2] Remove user_defined_section_attribute global Andrew Burgess
2016-06-10 16:56 ` [PATCH 1/2] gcc: Remove unneeded global flag Andrew Burgess
2016-06-22  2:55   ` Jeff Law
2016-06-22  6:02     ` Jakub Jelinek
2016-06-29 19:33     ` Andrew Burgess
2016-09-14 13:05       ` Ping: " Andrew Burgess
2016-09-14 13:08         ` Jakub Jelinek
2016-09-15 14:30           ` Andrew Burgess
2016-10-28 15:58             ` Jeff Law
2016-10-28 16:15               ` Andrew Burgess [this message]
2016-11-03 12:01         ` Bernd Schmidt
2016-11-16 20:09           ` Andrew Burgess
2016-11-16 21:00             ` Mike Stump
2016-11-16 22:12               ` Andrew Burgess
2016-11-17 17:59                 ` Jeff Law
2016-11-18 12:22                 ` Christophe Lyon
2016-11-19 21:59                   ` Andrew Burgess
2016-11-20 17:27                     ` Mike Stump
2016-11-21 12:47                       ` Christophe Lyon
2016-11-24 21:40                         ` Andrew Burgess
2016-11-28 22:09                           ` Jeff Law
2016-11-29 14:03                             ` Andrew Burgess
2016-11-29 17:36                               ` Jeff Law
2016-11-30 11:40                                 ` Andrew Burgess
2016-06-10 16:57 ` [PATCH 2/2] gcc: Update comment in bb-reorder.c Andrew Burgess
2016-06-22  2:59   ` 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=20161028161446.GU19319@embecosm.com \
    --to=andrew.burgess@embecosm.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jakub@redhat.com \
    --cc=law@redhat.com \
    /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).