This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Use predicates for RTL objects


On Thu, Aug 08, 2019 at 08:31:28AM -0600, Jeff Law wrote:
> On 8/7/19 12:05 PM, Segher Boessenkool wrote:
> > It is not a class in the C++ sense.  Confusing this is not useful for
> > anyone.
> True, but they could be.

But then it would say  is_a (rtx_plus)  or similar.  We don't have
classes called "PLUS" :-)

> When David was working in this space a few
> years ago I concluded that the main value in sub-classing the various
> RTL operators just wansn't worth the effort.  Instead we focused on
> starting to tear apart things like the toplevel objects into rtx_insn
> and the like.  THere's little value in treating those as simple RTXs.
> INSN_LIST and the like were also ripe for this treatment.

Yup.  And there still are various casts around, so even this conversion
still isn't complete (but it is not bad at all :-) )

> The biggest value in making a real class for the operators things would
> be to move the runtime RTL checking into a compile-time check.

That ignores 90% of the errors RTL checking catches: memory corruption.

> > 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.
> Yup.  And continue pushing the rtx_insn bits deeper, tackling INSN_LIST,
> etc.

I'm all for it.

What I do *not* want to see is a partial conversion to C++ classes, doing
the easy bits, and leaving a gigantic mess for everything else.


Segher


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]