public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Segher Boessenkool <segher@kernel.crashing.org>
To: Arvind Sankar <nivedita@alum.mit.edu>,
	gcc@gcc.gnu.org,        richard.sandiford@arm.com
Subject: Re: Use predicates for RTL objects
Date: Thu, 08 Aug 2019 15:28:00 -0000	[thread overview]
Message-ID: <20190808152830.GE31406@gate.crashing.org> (raw)
In-Reply-To: <mpth86s10q9.fsf@arm.com>

On Thu, Aug 08, 2019 at 10:10:38AM +0100, Richard Sandiford wrote:
> Segher Boessenkool <segher@kernel.crashing.org> writes:
> > On Wed, Aug 07, 2019 at 01:39:53PM -0400, Arvind Sankar wrote:
> >> We already have, for eg, is_a <rtx_sequence *> (x), and there are
> >
> > Whis *is* a class.  And not all of us are happy with that, but since we
> > don't often have to see it at all, it's not so bad.
> 
> Speaking as someone who is happy about that[*]...
> 
> [*] ...at least in principle.  It isn't really a proper class yet
>     because we don't construct rtx sequences as rtx_sequence objects,
>     we just access them that way.  I was a bit surprised that this
>     was defined behaviour...

_In principle_, sure, I have nothing against C++ conversions if it has
advantages that outweigh their disadvantages.

> > If you really want to convert RTL to C++, you should start with getting
> > rid of rtx_format and rtx_class, and make REG_P etc. work just as they
> > have always done.
> 
> I don't think getting rid of rtx_format and rtx_class should
> necessarily be the first step.  The base class can still provide
> the traditional accessors (with runtime checking when enabled).

It is *the* core thing that needs to be changed if you want this to be
any other than pointless uglification.

Those two RTX fields are the core of how it works now.  If you want to
use C++ classes, instead, you need to replace them with some suitable
C++ thing.  And we need to see that design before we can say if it looks
acceptable at all.

> Another option would be to start adding derived classes for certain
> types of rtx, and actually constructing those types of rtx with the
> appropriate type.  It'd probably make sense to start with special-
> purposes rtxes like ADDRESS, DEBUG_IMPLICIT_PTR or SYMBOL_REF (which
> is already somewhat special).

I would prefer to see an overall design before making partial changes.

> IMO the advantages of using a proper class hierarchy would be:
> 
> - More static type checking.  Runtime RTL checking is still seen as too
>   expensive to enable by default even in development builds, so RTL goes
>   unchecked most of the time.

Many people enable it all the time.  It isn't so expensive compared to
other things.  --enable-checking=yes,rtl,tree saves more time than it
costs, ime, and "rtl" is not the most expensive in that.

> - More efficient layouts, rather than forcing every piece of information
>   outside the header to be in a pointer-sized field.

... and then the GC has to be tuned again.  Oh joy.  Well, it probably
is much detuned already, but :-)

It would be nice to see real numbers how much memory this would save, and
what that means for compiler runtime.


Segher

  reply	other threads:[~2019-08-08 15:28 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-07 16:15 Arvind Sankar
2019-08-07 17:33 ` Segher Boessenkool
2019-08-07 17:40   ` Arvind Sankar
2019-08-07 18:05     ` Segher Boessenkool
2019-08-07 18:58       ` Arvind Sankar
2019-08-08 15:04         ` Segher Boessenkool
2019-08-08 17:42           ` Arvind Sankar
2019-08-08 18:26             ` Segher Boessenkool
2019-08-08 18:53               ` Arvind Sankar
2019-08-08 20:28             ` Jeff Law
2019-08-08  9:10       ` Richard Sandiford
2019-08-08 15:28         ` Segher Boessenkool [this message]
2019-08-08 14:31       ` Jeff Law
2019-08-08 15:36         ` Segher Boessenkool
2019-08-08 17:07         ` Arvind Sankar
2019-08-08 20:11           ` Jeff Law
2019-08-09  8:06   ` Richard Biener
2019-08-08 15:04 ` Michael Matz
2019-08-08 17:12   ` Arvind Sankar
2019-08-08 18:14     ` Jakub Jelinek
2019-08-08 18:35       ` Arvind Sankar
2019-08-08 18:46         ` Jakub Jelinek
2019-08-08 20:32           ` Jeff Law
  -- strict thread matches above, loose matches on Subject: below --
2006-02-03  4:23 nathan bullock
2006-02-03  5:46 ` Ben Elliston

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=20190808152830.GE31406@gate.crashing.org \
    --to=segher@kernel.crashing.org \
    --cc=gcc@gcc.gnu.org \
    --cc=nivedita@alum.mit.edu \
    --cc=richard.sandiford@arm.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).